Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Gui::ItemModel Class Reference

#include <Gui/TreeModel/EntityTreeModel.hpp>

+ Inheritance diagram for Ra::Gui::ItemModel:
+ Collaboration diagram for Ra::Gui::ItemModel:

Public Slots

void addItem (const Engine::Scene::ItemEntry &ent)
 
void removeItem (const Engine::Scene::ItemEntry &ent)
 

Signals

void visibilityROChanged (Ra::Core::Utils::Index roIndex, bool visible)
 
- Signals inherited from Ra::Gui::TreeModel
void modelRebuilt ()
 Emitted when the model has been rebuilt.
 

Public Member Functions

 ItemModel (const Engine::RadiumEngine *engine, QObject *parent=nullptr)
 
const Engine::Scene::ItemEntrygetEntry (const QModelIndex &index) const
 
QModelIndex findEntryIndex (const Engine::Scene::ItemEntry &entry) const
 
- Public Member Functions inherited from Ra::Gui::TreeModel
 TreeModel (QObject *parent=nullptr)
 
void rebuildModel ()
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &child) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 

Protected Member Functions

void buildModel () override
 Internal function to build the tree.
 
std::string getHeaderString () const override
 
- Protected Member Functions inherited from Ra::Gui::TreeModel
TreeItemgetItem (const QModelIndex &index) const
 Get the tree item corresponding to the given index.
 
bool findInTree (const TreeItem *item) const
 Internal functions to check if an item is in the tree.
 
void printModel () const
 Prints elements in the model to stdout (debug only)
 
void setAllItemsChecked (bool checked=true)
 Set the check state of all items.
 
void setItemChecked (const QModelIndex &index, bool checked=true)
 Set the check state of one item and all of its children.
 

Protected Attributes

const Engine::RadiumEnginem_engine
 Engine instance.
 
- Protected Attributes inherited from Ra::Gui::TreeModel
std::unique_ptr< TreeItemm_rootItem
 Root of the tree.
 

Detailed Description

Implementation of QAbstractItemModel to show the engine objects as a tree in the main GUI.

Definition at line 29 of file EntityTreeModel.hpp.

Constructor & Destructor Documentation

◆ ItemModel()

Ra::Gui::ItemModel::ItemModel ( const Engine::RadiumEngine * engine,
QObject * parent = nullptr )
inlineexplicit

Definition at line 33 of file EntityTreeModel.hpp.

Member Function Documentation

◆ addItem

void Ra::Gui::ItemModel::addItem ( const Engine::Scene::ItemEntry & ent)
slot

Definition at line 71 of file EntityTreeModel.cpp.

◆ buildModel()

void Ra::Gui::ItemModel::buildModel ( )
overrideprotectedvirtual

Internal function to build the tree.

Implements Ra::Gui::TreeModel.

Definition at line 17 of file EntityTreeModel.cpp.

+ Here is the call graph for this function:

◆ findEntryIndex()

QModelIndex Ra::Gui::ItemModel::findEntryIndex ( const Engine::Scene::ItemEntry & entry) const

Returns the index corresponding to the given entry if it exists in the model, or an invalid index if not found.

Definition at line 49 of file EntityTreeModel.cpp.

+ Here is the call graph for this function:

◆ getEntry()

const ItemEntry & Ra::Gui::ItemModel::getEntry ( const QModelIndex & index) const

Returns the entry corresponding to a given index or an invalid entry if the index doesn't match any entry.

Definition at line 45 of file EntityTreeModel.cpp.

+ Here is the call graph for this function:

◆ getHeaderString()

std::string Ra::Gui::ItemModel::getHeaderString ( ) const
inlineoverrideprotectedvirtual

Implements Ra::Gui::TreeModel.

Definition at line 69 of file EntityTreeModel.hpp.

◆ removeItem

void Ra::Gui::ItemModel::removeItem ( const Engine::Scene::ItemEntry & ent)
slot

Definition at line 121 of file EntityTreeModel.cpp.

Member Data Documentation

◆ m_engine

const Engine::RadiumEngine* Ra::Gui::ItemModel::m_engine
protected

Engine instance.

Definition at line 73 of file EntityTreeModel.hpp.


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