Radium Engine  1.5.20
Loading...
Searching...
No Matches
TreeModel.hpp File Reference
#include <Gui/RaGui.hpp>
#include <memory>
#include <vector>
#include <QAbstractItemModel>
#include <QVariant>
+ Include dependency graph for TreeModel.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Ra::Gui::TreeItem
 Base class for element of the tree representation. More...
 
class  Ra::Gui::TreeModel
 

Namespaces

namespace  Ra
 hepler function to manage enum as underlying types in VariableSet
 

Detailed Description

This file contains a basic implementation of a tree model object with QAbstractItemModel See http://doc.qt.io/qt-5/qtwidgets-itemviews-simpletreemodel-example.html This could have been a template with the object type, but QObjects cannot be templated, which is very sad. To use this base class you must :

  • create a derived class from TreeItem which links the model with actual objects for example by storing a handle or a pointer.
  • create a derived class from TreeModel. Add items of the derived TreeItem class to the tree, and static_cast the result of getItem to the concrete class to use it.

Definition in file TreeModel.hpp.