Commit 7b7dddbb authored by Ulf Hermann's avatar Ulf Hermann
Browse files

Timeline: Adapt test case for behavior change in selection handling



Change-Id: I560cce362964baf9877d5a4833223ca0669b6d0c
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 15300d8c
......@@ -148,19 +148,23 @@ void tst_TimelineRenderer::mouseEvents()
model.setExpanded(true);
testMouseEvents(&renderer, 1, 1);
QCOMPARE(renderer.selectedItem(), 3);
QCOMPARE(renderer.selectionLocked(), false); // toggle the locked status by clicking same item
QCOMPARE(renderer.selectionLocked(), true); // Don't toggle locked status by clicking same item
renderer.setSelectionLocked(false);
testMouseEvents(&renderer, 1, 1);
QCOMPARE(renderer.selectedItem(), 3);
QCOMPARE(renderer.selectionLocked(), true);
QCOMPARE(renderer.selectionLocked(), false);
renderer.setSelectionLocked(true);
testMouseEvents(&renderer, 1, 40);
QCOMPARE(renderer.selectedItem(), -1);
QCOMPARE(renderer.selectionLocked(), false); // unset locked by clicking empty space
QCOMPARE(renderer.selectionLocked(), true); // Don't unset locked by clicking empty space
renderer.setSelectionLocked(false);
testMouseEvents(&renderer, 1, 400);
QCOMPARE(renderer.selectedItem(), -1);
QCOMPARE(renderer.selectionLocked(), false);
testMouseEvents(&renderer, 10, 1);
QCOMPARE(renderer.selectedItem(), 19);
QCOMPARE(renderer.selectionLocked(), true);
QCOMPARE(renderer.selectionLocked(), false);
renderer.setSelectionLocked(true);
renderer.selectNextFromSelectionId(4);
QCOMPARE(renderer.selectedItem(), 8);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment