summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp4
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h6
-rw-r--r--tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp4
3 files changed, 11 insertions, 3 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index b0708a1074..a47d760e97 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -260,6 +260,7 @@ QItemSelectionRange QItemSelectionRange::intersected(const QItemSelectionRange &
*/
+#if QT_DEPRECATED_SINCE(5, 15)
/*!
Returns \c true if the selection range is less than the \a other
range given; otherwise returns \c false.
@@ -298,6 +299,7 @@ bool QItemSelectionRange::operator<(const QItemSelectionRange &other) const
std::less<const QAbstractItemModel *> less;
return less(tl.model(), other.tl.model());
}
+#endif
/*!
\fn bool QItemSelectionRange::isValid() const
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index 8b3560435c..f2545bf93c 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -98,7 +98,9 @@ public:
{ return (tl == other.tl && br == other.br); }
inline bool operator!=(const QItemSelectionRange &other) const
{ return !operator==(other); }
- bool operator<(const QItemSelectionRange &other) const;
+#if QT_DEPRECATED_SINCE(5, 15)
+ QT_DEPRECATED bool operator<(const QItemSelectionRange &other) const;
+#endif
inline bool isValid() const
{
diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
index 92f9c87b9f..e9bc0581be 100644
--- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -82,8 +82,10 @@ private slots:
void layoutChangedWithAllSelected2();
void layoutChangedTreeSelection();
void deselectRemovedMiddleRange();
+#if QT_DEPRECATED_SINCE(5, 15)
void rangeOperatorLessThan_data();
void rangeOperatorLessThan();
+#endif
void setModel();
void testDifferentModels();
@@ -2445,6 +2447,7 @@ static QStandardItemModel* getModel(QObject *parent)
return model;
}
+#if QT_DEPRECATED_SINCE(5, 15)
enum Result {
LessThan,
NotLessThan,
@@ -2579,6 +2582,7 @@ void tst_QItemSelectionModel::rangeOperatorLessThan()
if (!(r2 < r4))
QVERIFY(r4 < r2);
}
+#endif
void tst_QItemSelectionModel::setModel()
{