Navigation
API > API/Editor > API/Editor/PropertyEditor
Inheritance Hierarchy
- IStructureDataProvider
- FStructOnScopeStructureDataProvider
References
| Module | PropertyEditor |
| Header | /Engine/Source/Editor/PropertyEditor/Public/IStructureDataProvider.h |
| Include | #include "IStructureDataProvider.h" |
Syntax
class IStructureDataProvider
Remarks
IStructureDataProvider - Used to provide struct data for a property node.
The IsPropertyIndirection() and GetValueBaseAddress() allow a struct provider to expose data to be edited that is not supported by the property system. When IsPropertyIndirection() returns true, GetValueBaseAddress() is called relative to the parent property node to retrieve pointer to the data to be edited.
In the following example, a struct provider is added via ParentProperty property handle. In this case "ParentProperty" is the parent property node, and the value passed into GetValueBaseAddress() of the provider is the value of the parent property. TSharedPtr
The GetValueBaseAddress() may get called on foreign objects too (e.g. object templates), and if property indirection is used it should not rely on other values cached in the provider. class FMyStructProvider : public IStructureDataProvider { public: ...
virtual bool IsPropertyIndirection() const override { return true; }
virtual uint8* GetValueBaseAddress(uint8* ParentValueAddress, const UStruct* ExpectedType) const override
{
if (ParentValueAddress)
{
// "ParentValueAddress" is pointer to a value of the type defined in "ParentProperty".
FMyStruct& Value = *reinterpret_cast
If IsPropertyIndirection() is false, there structures are expected to be standalone, and GetInstances() is used instead to retried the instance values. When indirection is not used and the struct provider is part of an another instance, the provider should return only one instance, since there is no to associate the provided value with an foreign object.
Multiple instances are supported when the provider is the root node (e.g. on Structure details view).
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| const UStruct * | |||
| void | GetInstances
(
TArray< TSharedPtr< FStructOnScope >>& OutInstances |
||
| uint8 * | GetValueBaseAddress
(
uint8* ParentValueAddress, |
Returns base address of provided struct based on parent property nodes value. | |
| bool | |||
| bool | IsValid () |