diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-12-05 22:32:39 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-12-02 20:22:20 +0000 |
commit | 5497e6de89fa85f6367a558419d35af117a16a38 (patch) | |
tree | 8c05a9874ccd040669f491c891830495911b755e /src/corelib/itemmodels/qitemselectionmodel.h | |
parent | 2c634a132696376a0a0d7641bf05ae875c50190e (diff) |
QItemSelectionRange: de-inline op<
It's a bit large for an inline function.
Note for Qt 6 that this function is nonsense.
Change-Id: If6af5d3538aac86d55313ba6accdb13f892e6564
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/corelib/itemmodels/qitemselectionmodel.h')
-rw-r--r-- | src/corelib/itemmodels/qitemselectionmodel.h | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index 3d3cb00750..92c459a243 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -116,30 +116,7 @@ public: { return (tl == other.tl && br == other.br); } inline bool operator!=(const QItemSelectionRange &other) const { return !operator==(other); } - inline bool operator<(const QItemSelectionRange &other) const - { - // Comparing parents will compare the models, but if two equivalent ranges - // in two different models have invalid parents, they would appear the same - if (other.tl.model() == tl.model()) { - // parent has to be calculated, so we only do so once. - const QModelIndex topLeftParent = tl.parent(); - const QModelIndex otherTopLeftParent = other.tl.parent(); - if (topLeftParent == otherTopLeftParent) { - if (other.tl.row() == tl.row()) { - if (other.tl.column() == tl.column()) { - if (other.br.row() == br.row()) { - return br.column() < other.br.column(); - } - return br.row() < other.br.row(); - } - return tl.column() < other.tl.column(); - } - return tl.row() < other.tl.row(); - } - return topLeftParent < otherTopLeftParent; - } - return tl.model() < other.tl.model(); - } + bool operator<(const QItemSelectionRange &other) const; inline bool isValid() const { |