forked from qt-creator/qt-creator
TreeModel: Add a sibling() implementation
The base implementation uses the parent() index, which in turn accesses the grand parent level. We can save a few cycles here. Change-Id: I3c3696118fe7c3d4563ee3cd28981fca62013828 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -188,6 +188,7 @@ protected:
|
||||
QVariant data(const QModelIndex &idx, int role) const override;
|
||||
QModelIndex index(int, int, const QModelIndex &idx = QModelIndex()) const override;
|
||||
QModelIndex parent(const QModelIndex &idx) const override;
|
||||
QModelIndex sibling(int row, int column, const QModelIndex &idx) const override;
|
||||
Qt::ItemFlags flags(const QModelIndex &idx) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
bool hasChildren(const QModelIndex &idx) const override;
|
||||
|
||||
Reference in New Issue
Block a user