forked from qt-creator/qt-creator
TreeModel: Introduce a TreeItem::indexInParent() convenience function
To shorten user code and hide the ugly const_cast. Change-Id: I798bd105932004ea17cb95b243fc38ccfcda0a2c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -65,6 +65,7 @@ public:
|
||||
int level() const;
|
||||
|
||||
int childCount() const { return m_children.size(); }
|
||||
int indexInParent() const;
|
||||
TreeItem *childAt(int index) const;
|
||||
QVector<TreeItem *> children() const { return m_children; }
|
||||
QModelIndex index() const;
|
||||
|
||||
Reference in New Issue
Block a user