Shows all objects in a QTModelManager in a tree hierarchy view that allows for user interaction.
More...
|
| | SceneTree (QTModelManager *manager, QWidget *parent=nullptr) |
| | Constructs a scene tree from a model manager.
|
| | SceneTree (QTModelManagerView *view, QWidget *parent=nullptr) |
| | Constructs a scene tree from a model manager view.
|
| void | contextMenu (const QPoint &pos) |
| | Opens a context menu at the given position.
|
| void | createContextMenu (const Buffer< UUID > &ids, const QPoint &pos) |
| | Creates and displays a context menu for the given objects at the specified position.
|
|
void | initialize () |
| | Initializes the tree view, connecting signals and setting up delegates.
|
| QTModelManager * | manager () const |
| | Retrieves the model manager used by this tree.
|
| Buffer< UUID > | selectedObjects () const |
| | Retrieves the UUIDs of all currently selected objects.
|
| void | setCustomHeader (const TranslatedString &header_title, const StringView &header_icon=StringView(), bool allow_click=true) |
| | Sets a custom header for the tree view.
|
| void | setCustomSizeHint (const QSize &size) |
| | Sets a custom size hint for the tree widget.
|
| void | setIsRootFilter (const std::function< bool(const Model &)> &filter) |
| | Sets a filter function that determines which models appear as root nodes.
|
| void | setRootModels (const Buffer< UUID > &ids) |
| | Sets the root models displayed in the tree.
|
| void | setShowMaterials (bool show_materials) |
| | Sets whether materials are shown as child items in the tree.
|
| void | setVisibleFilter (const std::function< bool(const Model &)> &filter) |
| | Sets a filter function that determines which models are visible in the tree.
|
| void | updateExpanded (const QModelIndex &index) |
| | Updates the expanded state for a given index.
|
| void | updateFocus (UUID id, bool focussed) |
| | Updates the focus state of an object in the tree.
|
| void | updateModel (UUID id) |
| | Updates the display of a model in the tree.
|
| void | updateSelection (Buffer< UUID > ids, bool selected) |
| | Updates the selection state of objects in the tree.
|
|
| void | onCollapsedSlot (const QModelIndex &index) |
| | Handles item collapse events.
|
| void | onExpandedSlot (const QModelIndex &index) |
| | Handles item expansion events.
|
|
void | setup () |
| | Sets up the tree view connections and model.
|
Shows all objects in a QTModelManager in a tree hierarchy view that allows for user interaction.
Definition at line 53 of file SceneTree.h.
◆ SceneTree() [1/2]
| SceneTree::SceneTree |
( |
QTModelManager * | manager, |
|
|
QWidget * | parent = nullptr ) |
|
explicit |
Constructs a scene tree from a model manager.
- Parameters
-
| [in] | manager | The model manager to display. |
| [in] | parent | The parent widget. |
References manager().
◆ SceneTree() [2/2]
Constructs a scene tree from a model manager view.
- Parameters
-
| [in] | view | The model manager view to display. |
| [in] | parent | The parent widget. |
◆ contextMenu()
| void SceneTree::contextMenu |
( |
const QPoint & | pos | ) |
|
Opens a context menu at the given position.
- Parameters
-
| [in] | pos | The position for the context menu. |
◆ createContextMenu()
| void SceneTree::createContextMenu |
( |
const Buffer< UUID > & | ids, |
|
|
const QPoint & | pos ) |
Creates and displays a context menu for the given objects at the specified position.
- Parameters
-
| [in] | ids | The UUIDs of the selected objects. |
| [in] | pos | The screen position for the menu. |
◆ manager()
◆ onCollapsedSlot()
| void SceneTree::onCollapsedSlot |
( |
const QModelIndex & | index | ) |
|
|
protected |
Handles item collapse events.
- Parameters
-
| [in] | index | The collapsed index. |
◆ onExpandedSlot()
| void SceneTree::onExpandedSlot |
( |
const QModelIndex & | index | ) |
|
|
protected |
Handles item expansion events.
- Parameters
-
| [in] | index | The expanded index. |
◆ selectedObjects()
| Buffer< UUID > SceneTree::selectedObjects |
( |
| ) |
const |
Retrieves the UUIDs of all currently selected objects.
- Returns
- A buffer of selected object UUIDs.
◆ setCustomHeader()
Sets a custom header for the tree view.
- Parameters
-
| [in] | header_title | The translated title for the header. |
| [in] | header_icon | The icon identifier for the header. |
| [in] | allow_click | Whether clicking the header triggers an action. |
◆ setCustomSizeHint()
| void SceneTree::setCustomSizeHint |
( |
const QSize & | size | ) |
|
Sets a custom size hint for the tree widget.
- Parameters
-
| [in] | size | The custom size hint. |
◆ setIsRootFilter()
| void SceneTree::setIsRootFilter |
( |
const std::function< bool(const Model &)> & | filter | ) |
|
Sets a filter function that determines which models appear as root nodes.
- Parameters
-
| [in] | filter | A function returning true for models that should be roots. |
◆ setRootModels()
| void SceneTree::setRootModels |
( |
const Buffer< UUID > & | ids | ) |
|
Sets the root models displayed in the tree.
- Parameters
-
| [in] | ids | The UUIDs of the root models. |
◆ setShowMaterials()
| void SceneTree::setShowMaterials |
( |
bool | show_materials | ) |
|
Sets whether materials are shown as child items in the tree.
- Parameters
-
| [in] | show_materials | Whether to show materials. |
◆ setVisibleFilter()
| void SceneTree::setVisibleFilter |
( |
const std::function< bool(const Model &)> & | filter | ) |
|
Sets a filter function that determines which models are visible in the tree.
- Parameters
-
| [in] | filter | A function returning true for models that should be shown. |
◆ updateExpanded()
| void SceneTree::updateExpanded |
( |
const QModelIndex & | index | ) |
|
Updates the expanded state for a given index.
- Parameters
-
| [in] | index | The model index to update. |
◆ updateFocus()
| void SceneTree::updateFocus |
( |
UUID | id, |
|
|
bool | focussed ) |
Updates the focus state of an object in the tree.
- Parameters
-
| [in] | id | The UUID of the object. |
| [in] | focussed | Whether the object gained focus. |
◆ updateModel()
| void SceneTree::updateModel |
( |
UUID | id | ) |
|
Updates the display of a model in the tree.
- Parameters
-
| [in] | id | The UUID of the model to update. |
◆ updateSelection()
| void SceneTree::updateSelection |
( |
Buffer< UUID > | ids, |
|
|
bool | selected ) |
Updates the selection state of objects in the tree.
- Parameters
-
| [in] | ids | The UUIDs of the affected objects. |
| [in] | selected | Whether the objects were selected or deselected. |
The documentation for this class was generated from the following file: