diff options
author | Stephen Kelly <stephen@kdab.com> | 2010-08-19 16:41:40 (GMT) |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2010-08-19 16:41:40 (GMT) |
commit | 6e24bef57683b26f7cc1c4cddacace413d181d00 (patch) | |
tree | 00edc3ad4c8fe64f40ab09550e039e52c05b5d09 /src/gui/itemviews | |
parent | 9b4c6ab8e27873c133f16ea655d7220b1ba348cf (diff) | |
download | Qt-6e24bef57683b26f7cc1c4cddacace413d181d00.zip Qt-6e24bef57683b26f7cc1c4cddacace413d181d00.tar.gz Qt-6e24bef57683b26f7cc1c4cddacace413d181d00.tar.bz2 |
Make the QItemSelectionRange and QItemSelectionModel ensure that the model is correct.
Merge-request: 720
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qitemselectionmodel.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp index 4979db6..7156b87 100644 --- a/src/gui/itemviews/qitemselectionmodel.cpp +++ b/src/gui/itemviews/qitemselectionmodel.cpp @@ -212,6 +212,7 @@ bool QItemSelectionRange::intersects(const QItemSelectionRange &other) const { return (isValid() && other.isValid() && parent() == other.parent() + && model() == other.model() && ((top() <= other.top() && bottom() >= other.top()) || (top() >= other.top() && top() <= other.bottom())) && ((left() <= other.left() && right() >= other.left()) @@ -508,7 +509,7 @@ void QItemSelection::merge(const QItemSelection &other, QItemSelectionModel::Sel void QItemSelection::split(const QItemSelectionRange &range, const QItemSelectionRange &other, QItemSelection *result) { - if (range.parent() != other.parent()) + if (range.parent() != other.parent() || range.model() != other.model()) return; QModelIndex parent = other.parent(); |