diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-21 10:47:18 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-22 14:09:35 +0000 |
commit | 4d26036772f897c293d8f71d728ed41c720a85e8 (patch) | |
tree | 515682cfd3ab00e8c91940c12b1784a8366b1537 /tests/auto/controls/data/tst_stackview.qml | |
parent | bb3c8c3a9441d934acde7cf120ccba8a3852422c (diff) |
StackView: fix overly zealous child mouse event filter
Change-Id: Ife8ec7e14f940068a809cdf7a715a1790cce3f66
Task-number: QTBUG-50305
Reviewed-by: Nikita Krupenko <krnekit@gmail.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_stackview.qml')
-rw-r--r-- | tests/auto/controls/data/tst_stackview.qml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml index 2eb802bf..762be4cc 100644 --- a/tests/auto/controls/data/tst_stackview.qml +++ b/tests/auto/controls/data/tst_stackview.qml @@ -761,6 +761,45 @@ TestCase { control.destroy() } + Component { + id: mouseArea + MouseArea { + property int presses: 0 + property int releases: 0 + property int clicks: 0 + property int doubleClicks: 0 + property int cancels: 0 + onPressed: ++presses + onReleased: ++releases + onClicked: ++clicks + onDoubleClicked: ++doubleClicks + onCanceled: ++cancels + } + } + + // QTBUG-50305 + function test_events() { + var control = stackView.createObject(testCase, {initialItem: mouseArea, width: testCase.width, height: testCase.height}) + verify(control) + + var testItem = control.currentItem + verify(testItem) + + testItem.doubleClicked.connect(function() { + control.push(mouseArea) // ungrab -> cancel + }) + + mouseDoubleClickSequence(testItem) + compare(testItem.presses, 2) + compare(testItem.releases, 2) + compare(testItem.clicks, 1) + compare(testItem.doubleClicks, 1) + compare(testItem.pressed, false) + compare(testItem.cancels, 0) + + control.destroy() + } + function test_failures() { var control = stackView.createObject(testCase, {initialItem: component}) verify(control) |