IN THIS ARTICLE
O3DE UI Reflected Property Editor
A reflected property editor automatically lays out controls for user-editable properties that are reflected using the edit context. It is frequently used as a content widget to populate card components.
For more information about reflecting and the edit context, refer to Reflecting a Component for Serialization and Editing in the O3DE User Guide.
Reflected property editor in a card
The following code shows how to add a simple reflected property editor to a card, like the one pictured in the image at the beginning of this topic.
Example
#include <AzToolsFramework/UI/PropertyEditor/ReflectedPropertyEditor.hxx>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzQtComponents/Components/Widgets/Card.h>
// Create a card widget and set its title and header icon.
AzQtComponents::Card* card = new AzQtComponents::Card(parent);
card->setTitle(QStringLiteral("Card"));
card->header()->setIcon(QIcon(QStringLiteral(":/Gallery/Grid-small.svg")));
// Create a reflected property editor.
auto cardPropertyEditor = aznew AzToolsFramework::ReflectedPropertyEditor(card);
// Add the reflected property editor to the card as a content widget.
card->setContentWidget(cardPropertyEditor);
C++ API reference
For details on the card API, see the following topics in the O3DE UI Extensions C++ API Reference:
Related links
For additional information related to the reflected property editor component, see the following topics: