Fix SelectionRectangle tests
- Press-and-hold needs a release after the press.
- Doing press-and-hold at 1,1 selects the top-left cell; at that time if
we click at 1,1 again in an effort to get rid of the selection, we're
actually clicking on a selection handle. Let's click outside instead.
Amends c52710c10c
Pick-to: 6.5 6.6
Change-Id: If5d459c063d2e2e1aa27a3bf0e13e8515607e701
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
3240470c94
commit
5b63e2a426
|
@ -278,7 +278,7 @@ TestCase {
|
|||
|
||||
// Ensure that a press and hold doesn't start a selection
|
||||
mousePress(tableView, 1, 1, Qt.LeftButton)
|
||||
mousePress(tableView, 1, 1, Qt.LeftButton, Qt.NoModifier, 1000)
|
||||
mouseRelease(tableView, 1, 1, Qt.LeftButton, Qt.NoModifier, 1000)
|
||||
verify(!tableView.selectionModel.hasSelection)
|
||||
}
|
||||
|
||||
|
@ -537,7 +537,7 @@ TestCase {
|
|||
verify(!tableView.selectionModel.hasSelection)
|
||||
// Do a press and hold
|
||||
mousePress(tableView, 1, 1, Qt.LeftButton)
|
||||
mousePress(tableView, 1, 1, Qt.LeftButton, Qt.NoModifier, 1000)
|
||||
mouseRelease(tableView, 1, 1, Qt.LeftButton, Qt.NoModifier, 1000)
|
||||
verify(tableView.selectionModel.hasSelection)
|
||||
compare(tableView.selectionModel.selectedIndexes.length, 1)
|
||||
verify(tableView.selectionModel.isSelected(tableView.model.index(0, 0)))
|
||||
|
@ -546,7 +546,7 @@ TestCase {
|
|||
compare(activeSpy.count, 1)
|
||||
|
||||
// Remove selection
|
||||
mouseClick(tableView, 1, 1, Qt.LeftButton)
|
||||
mouseClick(tableView, 100, 100, Qt.LeftButton)
|
||||
verify(!tableView.selectionModel.hasSelection)
|
||||
compare(draggingSpy.count, 0)
|
||||
compare(activeSpy.count, 2)
|
||||
|
|
Loading…
Reference in New Issue