|
Krita Source Code Documentation
|
#include <kis_model_index_converter.h>
Inheritance diagram for KisModelIndexConverter:Public Member Functions | |
| KisNodeDummy * | dummyFromIndex (QModelIndex index) override |
| KisNodeDummy * | dummyFromRow (int row, QModelIndex parent) override |
| bool | indexFromAddedDummy (KisNodeDummy *parentDummy, int index, const QString &newNodeMetaObjectType, QModelIndex &parentIndex, int &row) override |
| QModelIndex | indexFromDummy (KisNodeDummy *dummy) override |
| KisModelIndexConverter (KisDummiesFacadeBase *dummiesFacade, KisNodeModel *model, bool showGlobalSelection) | |
| int | rowCount (QModelIndex parent) override |
Public Member Functions inherited from KisModelIndexConverterBase | |
| virtual | ~KisModelIndexConverterBase () |
Private Member Functions | |
| bool | checkDummyMetaObjectType (const QString &type) |
| bool | checkDummyType (KisNodeDummy *dummy) |
Private Attributes | |
| KisDummiesFacadeBase * | m_dummiesFacade |
| KisNodeModel * | m_model |
| bool | m_showGlobalSelection |
The class for converting to/from QModelIndex and KisNodeDummy when the root node is hidden (ShowRootLayer == false). All the selection masks owned by the root layer are hidden as well.
Definition at line 22 of file kis_model_index_converter.h.
| KisModelIndexConverter::KisModelIndexConverter | ( | KisDummiesFacadeBase * | dummiesFacade, |
| KisNodeModel * | model, | ||
| bool | showGlobalSelection ) |
Definition at line 18 of file kis_model_index_converter.cpp.
|
inlineprivate |
Definition at line 32 of file kis_model_index_converter.cpp.
References m_showGlobalSelection.
|
inlineprivate |
Definition at line 27 of file kis_model_index_converter.cpp.
References KisNodeDummy::isGUIVisible(), and m_showGlobalSelection.
|
overridevirtual |
Returns the dummy associated with the index WARNING: index must be valid
Implements KisModelIndexConverterBase.
Definition at line 78 of file kis_model_index_converter.cpp.
|
overridevirtual |
Returns the dummy staying in the specified row of a parent May return null in case of inconsistency
Implements KisModelIndexConverterBase.
Definition at line 43 of file kis_model_index_converter.cpp.
References KisNodeDummy::at(), checkDummyType(), KisNodeDummy::childCount(), dummyFromIndex(), KisNodeDummy::lastChild(), m_dummiesFacade, KisNodeDummy::parent(), KisNodeDummy::prevSibling(), KisDummiesFacadeBase::rootDummy(), and rowCount().
|
overridevirtual |
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 |
Implements KisModelIndexConverterBase.
Definition at line 117 of file kis_model_index_converter.cpp.
References checkDummyMetaObjectType(), checkDummyType(), KisNodeDummy::childCount(), indexFromDummy(), KisNodeDummy::lastChild(), KisNodeDummy::parent(), KisNodeDummy::prevSibling(), and rowCount().
|
overridevirtual |
Returns the index corresponding to the position of the dummy in the model. Will return invalid index if the dummy should be hidden
Implements KisModelIndexConverterBase.
Definition at line 85 of file kis_model_index_converter.cpp.
References checkDummyType(), KisNodeDummy::childCount(), KisNodeDummy::indexOf(), KisNodeDummy::lastChild(), m_model, KisNodeDummy::parent(), KisNodeDummy::prevSibling(), and rowCount().
|
overridevirtual |
Returns the number of children of the given index of the model
Implements KisModelIndexConverterBase.
Definition at line 158 of file kis_model_index_converter.cpp.
References checkDummyType(), KisNodeDummy::childCount(), dummyFromIndex(), KisNodeDummy::lastChild(), m_dummiesFacade, KisNodeDummy::parent(), KisNodeDummy::prevSibling(), and KisDummiesFacadeBase::rootDummy().
|
private |
Definition at line 44 of file kis_model_index_converter.h.
|
private |
Definition at line 45 of file kis_model_index_converter.h.
|
private |
Definition at line 46 of file kis_model_index_converter.h.