diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-09-27 11:24:38 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-01 09:38:31 +0200 |
commit | 1511fb37cf5a15fbc1fd498ff122988cc0ef83c3 (patch) | |
tree | c0efc96106629fefc8cf15d77b56c9561a5667a7 /src/corelib/itemmodels | |
parent | 308987fb961e68f279a25a5e934bc66662f5f75a (diff) |
Return QPersistentModelIndexes from QItemSelectionRange.
They are stored as such anyway, and this allows clients to not have to
convert between QModelIndex and back so much. This should be
fully source-compatible.
Change-Id: Ia606ea082442089a0aae1583380c3710ce61d3d1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r-- | src/corelib/itemmodels/qitemselectionmodel.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index 9e379ad6d2..555401e621 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -72,8 +72,8 @@ public: inline int width() const { return br.column() - tl.column() + 1; } inline int height() const { return br.row() - tl.row() + 1; } - inline QModelIndex topLeft() const { return QModelIndex(tl); } - inline QModelIndex bottomRight() const { return QModelIndex(br); } + inline const QPersistentModelIndex &topLeft() const { return tl; } + inline const QPersistentModelIndex &bottomRight() const { return br; } inline QModelIndex parent() const { return tl.parent(); } inline const QAbstractItemModel *model() const { return tl.model(); } |