|
Krita Source Code Documentation
|
#include <kis_model_index_converter_base.h>
Inheritance diagram for KisModelIndexConverterBase:Public Member Functions | |
| virtual KisNodeDummy * | dummyFromIndex (QModelIndex index)=0 |
| virtual KisNodeDummy * | dummyFromRow (int row, QModelIndex parent)=0 |
| virtual bool | indexFromAddedDummy (KisNodeDummy *parentDummy, int index, const QString &newNodeMetaObjectType, QModelIndex &parentIndex, int &row)=0 |
| virtual QModelIndex | indexFromDummy (KisNodeDummy *dummy)=0 |
| virtual int | rowCount (QModelIndex parent)=0 |
| virtual | ~KisModelIndexConverterBase () |
The base class for converting objects to/from QModelIndex used in KisNodeModel and KisNodeDummy used in KisDummiesFacadeBase (KisShapeController).
This is not a trivial task, because the indexing of nodes is reversed in KisNodeModel.
Definition at line 24 of file kis_model_index_converter_base.h.
|
virtual |
Definition at line 10 of file kis_model_index_converter_base.cpp.
|
pure virtual |
Returns the dummy associated with the index WARNING: index must be valid
Implemented in KisModelIndexConverter, and KisModelIndexConverterShowAll.
|
pure virtual |
Returns the dummy staying in the specified row of a parent May return null in case of inconsistency
Implemented in KisModelIndexConverter, and KisModelIndexConverterShowAll.
|
pure virtual |
Calculates the parent and the position in the model for newly created dummy
| parentDummy | the dummy parent |
| index | the dummy index |
| newNodeMetaObjectType | is a class name of a newly added node This name is got from Qt's meta object system so you must compare this value against a corresponding staticMetaObject object only. We do not pass a pointer to a real node to limit the access to real nodes. |
| parentIndex | the parent index |
| row | the dummy row |
Implemented in KisModelIndexConverter, and KisModelIndexConverterShowAll.
|
pure virtual |
Returns the index corresponding to the position of the dummy in the model. Will return invalid index if the dummy should be hidden
Implemented in KisModelIndexConverter, and KisModelIndexConverterShowAll.
|
pure virtual |
Returns the number of children of the given index of the model
Implemented in KisModelIndexConverter, and KisModelIndexConverterShowAll.