From 1511fb37cf5a15fbc1fd498ff122988cc0ef83c3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 27 Sep 2012 11:24:38 +0200 Subject: 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 --- src/corelib/itemmodels/qitemselectionmodel.h | 4 ++-- 1 file 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(); } -- cgit v1.2.3