QItemSelectionModel: simplify QItemSelectionRange

Simplify QItemSelectionRange by removing the unneeded
user-defined functions - the compiler can generate them by it's own.

Change-Id: I49c00f937df98bb1ad18057b7bae7a0e06919909
Reviewed-by: David Faure <david.faure@kdab.com>
bb10
Christian Ehrlicher 2020-05-13 21:09:38 +02:00
parent f9874ad7bd
commit 8657296173
2 changed files with 1 additions and 31 deletions

View File

@ -86,14 +86,6 @@ QT_BEGIN_NAMESPACE
Constructs an empty selection range.
*/
/*!
\fn QItemSelectionRange::QItemSelectionRange(const QItemSelectionRange &other)
Copy constructor. Constructs a new selection range with the same contents
as the \a other range given.
*/
/*!
\fn QItemSelectionRange::QItemSelectionRange(const QModelIndex &topLeft, const QModelIndex &bottomRight)
@ -230,13 +222,6 @@ bool QItemSelectionRange::intersects(const QItemSelectionRange &other) const
);
}
/*!
\fn QItemSelectionRange QItemSelectionRange::intersect(const QItemSelectionRange &other) const
\obsolete
Use intersected(\a other) instead.
*/
/*!
\fn QItemSelectionRange QItemSelectionRange::intersected(const QItemSelectionRange &other) const
\since 4.2

View File

@ -55,18 +55,7 @@ class Q_CORE_EXPORT QItemSelectionRange
{
public:
inline QItemSelectionRange() : tl(), br() {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// ### Qt 6: remove them all, the compiler-generated ones are fine
inline QItemSelectionRange(const QItemSelectionRange &other)
: tl(other.tl), br(other.br) {}
QItemSelectionRange(QItemSelectionRange &&other) noexcept
: tl(std::move(other.tl)), br(std::move(other.br)) {}
QItemSelectionRange &operator=(QItemSelectionRange &&other) noexcept
{ tl = std::move(other.tl); br = std::move(other.br); return *this; }
QItemSelectionRange &operator=(const QItemSelectionRange &other)
{ tl = other.tl; br = other.br; return *this; }
#endif // Qt < 6
QItemSelectionRange() = default;
QItemSelectionRange(const QModelIndex &topL, const QModelIndex &bottomR) : tl(topL), br(bottomR) {}
explicit QItemSelectionRange(const QModelIndex &index) : tl(index), br(tl) {}
@ -103,10 +92,6 @@ public:
}
bool intersects(const QItemSelectionRange &other) const;
#if QT_DEPRECATED_SINCE(5, 0)
inline QItemSelectionRange intersect(const QItemSelectionRange &other) const
{ return intersected(other); }
#endif
QItemSelectionRange intersected(const QItemSelectionRange &other) const;