diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_treeview.qml | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/tests/auto/controls/data/tst_treeview.qml b/tests/auto/controls/data/tst_treeview.qml index 139be338..902d2178 100644 --- a/tests/auto/controls/data/tst_treeview.qml +++ b/tests/auto/controls/data/tst_treeview.qml @@ -127,7 +127,7 @@ Item { spy.target = tree spy.signalName = "clicked" compare(spy.count, 0) - mouseClick(tree, semiIndent + 50, 120, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 120, Qt.LeftButton, Qt.NoModifier, 10) compare(spy.count, 1) var clickedItem = spy.signalArguments[0][0] verify(clickedItem.valid) @@ -201,7 +201,7 @@ Item { // expanded on click compare(spy.count, 0) - mouseClick(tree, semiIndent, 70, Qt.LeftButton) + mouseClick(tree, semiIndent, 70, Qt.LeftButton, Qt.NoModifier, 10) compare(spy.count, 1) var expandedIndex = spy.signalArguments[0][0] verify(expandedIndex.valid) @@ -268,8 +268,9 @@ Item { spy.target = tree spy.signalName = "pressAndHold" compare(spy.count, 0) - mousePress(tree, styleIndent + 50, 70, Qt.LeftButton) + mousePress(tree, styleIndent + 50, 70, Qt.LeftButton, Qt.NoModifier, 10) mouseRelease(tree, styleIndent + 50, 70, Qt.LeftButton, Qt.NoModifier, 1000) + wait(20) compare(spy.count, 1) verify(spy.signalArguments[0][0].valid) compare(spy.signalArguments[0][0].row, 0) @@ -288,7 +289,7 @@ Item { // select second item with no children verify(!tree.currentIndex.valid) - mouseClick(tree, semiIndent + 50, 120, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 120, Qt.LeftButton, Qt.NoModifier, 10) var secondTopItem = tree.currentIndex verify(secondTopItem.valid) verify(!secondTopItem.parent.valid) @@ -342,27 +343,27 @@ Item { selectionModel.model = tree.model // Collect some model index - mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton, Qt.NoModifier, 30) var firstItem = tree.currentIndex verify(firstItem.valid) compare(firstItem.row, 0) - mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton, Qt.NoModifier, 10) var secondItem = tree.currentIndex verify(secondItem.valid) compare(secondItem.row, 1) - mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton, Qt.NoModifier, 10) var thirdItem = tree.currentIndex verify(thirdItem.valid) compare(thirdItem.row, 2) - mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton, Qt.NoModifier, 10) var fourthItem = tree.currentIndex verify(fourthItem.valid) compare(fourthItem.row, 3) - mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton, Qt.NoModifier, 10) var fifthItem = tree.currentIndex verify(fifthItem.valid) compare(fifthItem.row, 4) - mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton, Qt.NoModifier, 10) var sixthItem = tree.currentIndex verify(sixthItem.valid) compare(sixthItem.row, 5) @@ -377,7 +378,7 @@ Item { compare(tree.selectionMode, SelectionMode.SingleSelection) verify(!tree.selection.currentIndex.valid) - mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton, Qt.NoModifier, 10) verify(tree.selection.currentIndex.valid) compare(secondItem.internalId, tree.currentIndex.internalId) @@ -467,17 +468,17 @@ Item { selectionModel.model = tree.model // Collect some model index - mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton, Qt.NoModifier0, 10) var firstItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton, Qt.NoModifier, 10) var secondItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton, Qt.NoModifier, 10) var thirdItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton, Qt.NoModifier, 10) var fourthItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton, Qt.NoModifier, 10) var fifthItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton, Qt.NoModifier, 10) var sixthItem = tree.currentIndex compare(tree.selection, null) @@ -490,7 +491,7 @@ Item { tree.selectionMode = SelectionMode.MultiSelection compare(tree.selectionMode, SelectionMode.MultiSelection) - mouseClick(tree, semiIndent + 50, 70+50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 70+50, Qt.LeftButton, Qt.NoModifier, 10) compare(secondItem.internalId, tree.currentIndex.internalId) compare(tree.selection.hasSelection, true) @@ -576,17 +577,17 @@ Item { selectionModel.model = tree.model // Collect some model index - mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton, Qt.NoModifier, 10) var firstItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 2*50, Qt.LeftButton, Qt.NoModifier, 10) var secondItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 3*50, Qt.LeftButton, Qt.NoModifier, 10) var thirdItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 4*50, Qt.LeftButton, Qt.NoModifier, 10) var fourthItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 5*50, Qt.LeftButton, Qt.NoModifier, 10) var fifthItem = tree.currentIndex - mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 20 + 6*50, Qt.LeftButton, Qt.NoModifier, 10) var sixthItem = tree.currentIndex compare(tree.selection, null) @@ -599,7 +600,7 @@ Item { tree.selectionMode = SelectionMode.ExtendedSelection compare(tree.selectionMode, SelectionMode.ExtendedSelection) - mouseClick(tree, semiIndent + 50, 70+50, Qt.LeftButton) + mouseClick(tree, semiIndent + 50, 70+50, Qt.LeftButton, Qt.NoModifier, 10) compare(secondItem.internalId, tree.currentIndex.internalId) compare(tree.selection.hasSelection, true) @@ -753,6 +754,7 @@ Item { verify(tree !== null, "tree created is null") verify(waitForRendering(tree), "TreeView did not render on time") var model = tree.model + wait(50) // Sample each row and test for (var row = 0; row < tree.__listView.count; row++) { @@ -764,7 +766,12 @@ Item { || treeIndex.internalId !== modelIndex.internalId) { console.log("Test about to fail: row = " + row + ", __listView.count =" + tree.__listView.count) console.log(" . . . . . . . . . x =" + x + ", getColumn(0).width =" + tree.getColumn(0).width) + console.log("pairs of should-be-equal values: ", + treeIndex.row, modelIndex.row, + treeIndex.column, modelIndex.column, + treeIndex.internalId, modelIndex.internalId) } + compare(treeIndex.row, modelIndex.row) compare(treeIndex.column, modelIndex.column) compare(treeIndex.internalId, modelIndex.internalId) |