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.

component reflected property editor in card

For more information about reflecting and the edit context, see the O3DE User Guide topic on Reflecting a Component for Serialization and Editing .

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 :

For additional information related to the reflected property editor component, see the following topics:


Copyright © 2022 Open 3D Engine Contributors

Documentation Distributed under CC BY 4.0.
For our trademark, privacy and antitrust policies, code of conduct, and terms of use, please click the applicable link below or see https://www.lfprojects.org.


The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Policy page.