diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2010-03-22 15:58:23 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2010-03-22 16:19:40 (GMT) |
commit | 8f6b8c5a9750d49e6b93804d37aa64140460bfa6 (patch) | |
tree | f8e21ffac9394ea3c6af41c878daa4634ef12eee /src/gui/itemviews | |
parent | 88c0d0b8e0e14528cb497d7ea6c30abdb14a4b1c (diff) | |
download | Qt-8f6b8c5a9750d49e6b93804d37aa64140460bfa6.zip Qt-8f6b8c5a9750d49e6b93804d37aa64140460bfa6.tar.gz Qt-8f6b8c5a9750d49e6b93804d37aa64140460bfa6.tar.bz2 |
Fix a problem with the selection losing items when layout is changed
Task-number: QTBUG-2804
Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qitemselectionmodel.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp index d066a96..d6e68f6 100644 --- a/src/gui/itemviews/qitemselectionmodel.cpp +++ b/src/gui/itemviews/qitemselectionmodel.cpp @@ -814,6 +814,10 @@ static QItemSelection mergeIndexes(const QList<QPersistentModelIndex> &indexes) while (++i < colSpans.count()) { QModelIndex nextTl = colSpans.at(i).topLeft(); QModelIndex nextBr = colSpans.at(i).bottomRight(); + + if (nextTl.parent() != tl.parent()) + break; // we can't merge selection ranges from different parents + if ((nextTl.column() == prevTl.column()) && (nextBr.column() == br.column()) && (nextTl.row() == prevTl.row() + 1) && (nextBr.row() == br.row() + 1)) { br = nextBr; |