Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::PrefabUiHandler Class Reference

Inherits AzToolsFramework::EditorEntityUiHandlerBase.

Inherited by AzToolsFramework::ProceduralPrefabUiHandler.

Public Member Functions

 AZ_CLASS_ALLOCATOR (PrefabUiHandler, AZ::SystemAllocator)
 
 AZ_RTTI (AzToolsFramework::PrefabUiHandler, "{598154A2-89E3-45CB-A3CB-337CB1C73DE7}", EditorEntityUiHandlerBase)
 
QString GenerateItemInfoString (AZ::EntityId entityId) const override
 Returns the item info string that is appended to the item name in the Outliner.
 
QString GenerateItemTooltip (AZ::EntityId entityId) const override
 Returns the item tooltip text to display in the Outliner.
 
QIcon GenerateItemIcon (AZ::EntityId entityId) const override
 Returns the item icon pixmap to display in the Outliner.
 
bool CanToggleLockVisibility (AZ::EntityId entityId) const override
 Returns whether the element's lock and visibility state should be accessible in the Outliner.
 
void PaintItemBackground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Paints the background of the item in the Outliner.
 
void PaintDescendantBackground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const QModelIndex &descendantIndex) const override
 Paints the background of the descendants of the item in the Outliner.
 
void PaintItemForeground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Paints visual elements on the foreground of the item in the Outliner.
 
void PaintDescendantForeground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const QModelIndex &descendantIndex) const override
 Paints visual elements on the foreground of the descendants of the item in the Outliner.
 
bool OnOutlinerItemClick (const QPoint &position, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
bool OnOutlinerItemDoubleClick (const QModelIndex &index) const override
 
void OnOutlinerItemCollapse (const QModelIndex &index) const override
 Triggered when an entity's children are collapsed in the Outliner.
 
- Public Member Functions inherited from AzToolsFramework::EditorEntityUiHandlerBase
 AZ_RTTI (EditorEntityUiHandlerBase, "{EFB6CBC0-3A0A-4302-92EB-62CAF1C47163}")
 
EditorEntityUiHandlerId GetHandlerId ()
 
virtual QString GenerateItemInfoString (AZ::EntityId entityId) const
 Returns the item info string that is appended to the item name in the Outliner.
 
virtual QString GenerateItemTooltip (AZ::EntityId entityId) const
 Returns the item tooltip text to display in the Outliner.
 
virtual QIcon GenerateItemIcon (AZ::EntityId entityId) const
 Returns the item icon pixmap to display in the Outliner.
 
virtual bool CanRename (AZ::EntityId entityId) const
 Returns whether the element's name should be editable.
 
virtual bool CanToggleLockVisibility (AZ::EntityId entityId) const
 Returns whether the element's lock and visibility state should be accessible in the Outliner.
 
virtual void PaintItemBackground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 Paints the background of the item in the Outliner.
 
virtual void PaintDescendantBackground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const QModelIndex &descendantIndex) const
 Paints the background of the descendants of the item in the Outliner.
 
virtual void PaintDescendantBranchBackground (QPainter *painter, const QTreeView *view, const QRect &rect, const QModelIndex &index, const QModelIndex &descendantIndex) const
 Paints the background of the descendant branches of the item in the Outliner.
 
virtual void PaintItemForeground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 Paints visual elements on the foreground of the item in the Outliner.
 
virtual void PaintDescendantForeground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const QModelIndex &descendantIndex) const
 Paints visual elements on the foreground of the descendants of the item in the Outliner.
 
virtual bool OnOutlinerItemClick (const QPoint &position, const QStyleOptionViewItem &option, const QModelIndex &index) const
 
virtual bool OnOutlinerItemDoubleClick (const QModelIndex &index) const
 
virtual void OnOutlinerItemExpand (const QModelIndex &index) const
 Triggered when an entity's children are expanded in the Outliner.
 
virtual void OnOutlinerItemCollapse (const QModelIndex &index) const
 Triggered when an entity's children are collapsed in the Outliner.
 

Protected Member Functions

const QPixmap & GetOverrideImageForEntity (AZ::EntityId entityId) const
 
void PaintDescendantBorder (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const QModelIndex &descendantIndex, const QColor borderColor) const
 

Static Protected Member Functions

static bool IsLastVisibleChild (const QModelIndex &parent, const QModelIndex &child)
 
static QModelIndex GetLastVisibleChild (const QModelIndex &parent)
 
- Static Protected Member Functions inherited from AzToolsFramework::EditorEntityUiHandlerBase
static AZ::EntityId GetEntityIdFromIndex (const QModelIndex &index)
 

Protected Attributes

ContainerEntityInterfacem_containerEntityInterface = nullptr
 
Prefab::PrefabFocusPublicInterfacem_prefabFocusPublicInterface = nullptr
 
Prefab::PrefabPublicInterfacem_prefabPublicInterface = nullptr
 
Prefab::PrefabOverridePublicInterfacem_prefabOverridePublicInterface = nullptr
 
QColor m_backgroundColor = QColor("#444444")
 
QColor m_backgroundHoverColor = QColor("#5A5A5A")
 
QColor m_backgroundSelectedColor = QColor("#656565")
 
QColor m_prefabCapsuleColor = QColor("#1E252F")
 
QColor m_prefabCapsuleDisabledColor = QColor("#35383C")
 
QColor m_prefabCapsuleEditColor = QColor("#4A90E2")
 
QString m_prefabIconPath = QString(":/Entity/prefab.svg")
 
QString m_prefabEditIconPath = QString(":/Entity/prefab_edit.svg")
 
QString m_prefabEditOpenIconPath = QString(":/Entity/prefab_edit_open.svg")
 
QString m_prefabEditCloseIconPath = QString(":/Entity/prefab_edit_close.svg")
 
QString m_editEntityOverrideImagePath = QString(":/Entity/entity_modified_as_override.svg")
 
QString m_addEntityOverrideImagePath = QString(":/Entity/entity_added_as_override.svg")
 
QPixmap m_editEntityOverrideImage
 
QPixmap m_addEntityOverrideImage
 

Static Protected Attributes

static AzFramework::EntityContextId s_editorEntityContextId
 
static const QPoint s_overrideImageOffset = QPoint(13, 12)
 
static const QSize s_overrideImageSize = QSize(7, 7)
 

Member Function Documentation

◆ CanToggleLockVisibility()

bool AzToolsFramework::PrefabUiHandler::CanToggleLockVisibility ( AZ::EntityId  entityId) const
overridevirtual

Returns whether the element's lock and visibility state should be accessible in the Outliner.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

◆ GenerateItemIcon()

QIcon AzToolsFramework::PrefabUiHandler::GenerateItemIcon ( AZ::EntityId  entityId) const
overridevirtual

Returns the item icon pixmap to display in the Outliner.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

◆ GenerateItemInfoString()

QString AzToolsFramework::PrefabUiHandler::GenerateItemInfoString ( AZ::EntityId  entityId) const
overridevirtual

Returns the item info string that is appended to the item name in the Outliner.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

◆ GenerateItemTooltip()

QString AzToolsFramework::PrefabUiHandler::GenerateItemTooltip ( AZ::EntityId  entityId) const
overridevirtual

Returns the item tooltip text to display in the Outliner.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

Reimplemented in AzToolsFramework::ProceduralPrefabUiHandler.

◆ OnOutlinerItemClick()

bool AzToolsFramework::PrefabUiHandler::OnOutlinerItemClick ( const QPoint &  position,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overridevirtual

Triggered when the entity is clicked in the Outliner.

Returns
True if the click has been handled and should not be propagated, false otherwise.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

◆ OnOutlinerItemCollapse()

void AzToolsFramework::PrefabUiHandler::OnOutlinerItemCollapse ( const QModelIndex &  index) const
overridevirtual

Triggered when an entity's children are collapsed in the Outliner.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

◆ OnOutlinerItemDoubleClick()

bool AzToolsFramework::PrefabUiHandler::OnOutlinerItemDoubleClick ( const QModelIndex &  index) const
overridevirtual

Triggered when the entity is double-clicked in the Outliner.

Returns
True if the double-click has been handled and should not be propagated, false otherwise.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

◆ PaintDescendantBackground()

void AzToolsFramework::PrefabUiHandler::PaintDescendantBackground ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index,
const QModelIndex &  descendantIndex 
) const
overridevirtual

Paints the background of the descendants of the item in the Outliner.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

◆ PaintDescendantForeground()

void AzToolsFramework::PrefabUiHandler::PaintDescendantForeground ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index,
const QModelIndex &  descendantIndex 
) const
overridevirtual

Paints visual elements on the foreground of the descendants of the item in the Outliner.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

◆ PaintItemBackground()

void AzToolsFramework::PrefabUiHandler::PaintItemBackground ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overridevirtual

Paints the background of the item in the Outliner.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.

◆ PaintItemForeground()

void AzToolsFramework::PrefabUiHandler::PaintItemForeground ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
overridevirtual

Paints visual elements on the foreground of the item in the Outliner.

Reimplemented from AzToolsFramework::EditorEntityUiHandlerBase.


The documentation for this class was generated from the following file: