From ebafb2f14bb2855176de17a1131c1e7db01f2e0c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 20 Mar 2015 10:19:00 +0100 Subject: QItemSelectionModel: Make selectedIndexes a Q_PROPERTY. With reasoning similar to commit v5.5.0-alpha1~124 (Make the QItemSelectionModel::selection a property., 2015-02-25), this should be a property instead of a Q_INVOKABLE so that it can participate in persistent bindings. Change-Id: Ib9a7900dfa3acbd6f9f7df7b6f00deb6e05c3937 Reviewed-by: J-P Nurmi --- src/corelib/itemmodels/qitemselectionmodel.cpp | 5 +++++ src/corelib/itemmodels/qitemselectionmodel.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index 3882da30a7..47fcab9b24 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -1734,6 +1734,11 @@ const QItemSelection QItemSelectionModel::selection() const /*! \since 5.5 + \property QItemSelectionModel::selectedIndexes +*/ +/*! + \since 5.5 + \property QItemSelectionModel::model \internal */ diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index 09fab78214..4fe836c098 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -147,6 +147,7 @@ class Q_CORE_EXPORT QItemSelectionModel : public QObject Q_PROPERTY(bool hasSelection READ hasSelection NOTIFY selectionChanged STORED false DESIGNABLE false) Q_PROPERTY(QModelIndex currentIndex READ currentIndex NOTIFY currentChanged STORED false DESIGNABLE false) Q_PROPERTY(QItemSelection selection READ selection NOTIFY selectionChanged STORED false DESIGNABLE false) + Q_PROPERTY(QModelIndexList selectedIndexes READ selectedIndexes NOTIFY selectionChanged STORED false DESIGNABLE false) Q_DECLARE_PRIVATE(QItemSelectionModel) @@ -184,7 +185,7 @@ public: bool hasSelection() const; - Q_INVOKABLE QModelIndexList selectedIndexes() const; + QModelIndexList selectedIndexes() const; Q_INVOKABLE QModelIndexList selectedRows(int column = 0) const; Q_INVOKABLE QModelIndexList selectedColumns(int row = 0) const; const QItemSelection selection() const; -- cgit v1.2.3