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. Amendsc52710c10c
Change-Id: If5d459c063d2e2e1aa27a3bf0e13e8515607e701 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit5b63e2a426
) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit1bc4315eaf
)
This commit is contained in:
parent
f7c656af68
commit
98ab3cef46
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -417,7 +417,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)))
|
||||
|
@ -426,7 +426,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