diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-09-01 11:03:15 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-09-01 11:03:15 (GMT) |
commit | c19bdfaf62c04e826f828922a4f1dac15e68caaa (patch) | |
tree | f8d920f4ebd9a158b3741f553839e1716f463094 /tests | |
parent | 126eeae15c4d4d6249e76bcea60a02da1f5407e5 (diff) | |
download | Qt-c19bdfaf62c04e826f828922a4f1dac15e68caaa.zip Qt-c19bdfaf62c04e826f828922a4f1dac15e68caaa.tar.gz Qt-c19bdfaf62c04e826f828922a4f1dac15e68caaa.tar.bz2 |
QTreeView autotest fails on Symbian VGA device
The autotest assumed that "unselect" click goes below treeview rows,
when it actually hit the second last row. Thus, again two items
(one row) was selected. As a fix, ensure that mouse click goes
underneath the treeview rows.
Task-number: QT-5056
Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qtreeview/tst_qtreeview.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index b902370..facb982 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -2384,6 +2384,14 @@ void tst_QTreeView::extendedSelection() QTreeView view(&topLevel); view.resize(qMax(mousePressPos.x() * 2, 200), qMax(mousePressPos.y() * 2, 200)); view.setModel(&model); + + //ensure that mousePressPos is below the last row if we want to unselect + if (!selectedCount) { + int minimumHeight = model.rowCount() * view.visualRect(model.index(0,0)).size().height(); + if (mousePressPos.y() < minimumHeight) + mousePressPos.setY(minimumHeight + 10); + } + view.setSelectionMode(QAbstractItemView::ExtendedSelection); topLevel.show(); QTest::mousePress(view.viewport(), Qt::LeftButton, 0, mousePressPos); |