diff options
Diffstat (limited to 'src/corelib/itemmodels/qitemselectionmodel.h')
-rw-r--r-- | src/corelib/itemmodels/qitemselectionmodel.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index 4237e7f74f..aaf32e68ef 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -57,12 +57,12 @@ public: bool intersects(const QItemSelectionRange &other) const; QItemSelectionRange intersected(const QItemSelectionRange &other) const; - +#if QT_CORE_REMOVED_SINCE(6, 8) inline bool operator==(const QItemSelectionRange &other) const - { return (tl == other.tl && br == other.br); } + { return comparesEqual(*this, other); } inline bool operator!=(const QItemSelectionRange &other) const - { return !operator==(other); } - + { return !operator==(other); } +#endif inline bool isValid() const { return (tl.isValid() && br.isValid() && tl.parent() == br.parent() @@ -74,6 +74,12 @@ public: QModelIndexList indexes() const; private: + friend bool comparesEqual(const QItemSelectionRange &lhs, + const QItemSelectionRange &rhs) noexcept + { + return comparesEqual(lhs.tl, rhs.tl) && comparesEqual(lhs.br, rhs.br); + } + Q_DECLARE_EQUALITY_COMPARABLE(QItemSelectionRange) QPersistentModelIndex tl, br; }; Q_DECLARE_TYPEINFO(QItemSelectionRange, Q_RELOCATABLE_TYPE); @@ -165,13 +171,6 @@ protected: private: Q_DISABLE_COPY(QItemSelectionModel) - Q_PRIVATE_SLOT(d_func(), void _q_columnsAboutToBeRemoved(const QModelIndex&, int, int)) - Q_PRIVATE_SLOT(d_func(), void _q_rowsAboutToBeRemoved(const QModelIndex&, int, int)) - Q_PRIVATE_SLOT(d_func(), void _q_columnsAboutToBeInserted(const QModelIndex&, int, int)) - Q_PRIVATE_SLOT(d_func(), void _q_rowsAboutToBeInserted(const QModelIndex&, int, int)) - Q_PRIVATE_SLOT(d_func(), void _q_layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoHint)) - Q_PRIVATE_SLOT(d_func(), void _q_layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoHint)) - Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed()) }; Q_DECLARE_OPERATORS_FOR_FLAGS(QItemSelectionModel::SelectionFlags) |