From 4339a686c190605121a327f703e96dae8b9451d5 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 31 May 2017 18:44:57 +0200 Subject: Add Popup::opened [ChangeLog][Controls][Popup] Added an "opened" boolean property that holds whether a popup is fully open. That is, the popup is visible and neither the enter nor exit transitions are running. Change-Id: I18a1403be381c113fdbcc4211e267f68632984b7 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_popup.qml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index bec50ad0..c8b3985c 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -1178,16 +1178,6 @@ TestCase { compare(child.ApplicationWindow.window, null) } - SignalSpy { - id: openedSpy - signalName: "opened" - } - - SignalSpy { - id: closedSpy - signalName: "closed" - } - Component { id: pausePopup Popup { @@ -1200,19 +1190,32 @@ TestCase { var control = createTemporaryObject(pausePopup, testCase) verify(control) - openedSpy.target = control - closedSpy.target = control + var openedSpy = createTemporaryObject(signalSpy, testCase, {target: control, signalName: "opened"}) + verify(openedSpy.valid) + var closedSpy = createTemporaryObject(signalSpy, testCase, {target: control, signalName: "closed"}) + verify(closedSpy.valid) + var openedChangeSpy = createTemporaryObject(signalSpy, testCase, {target: control, signalName: "openedChanged"}) + verify(openedChangeSpy.valid) control.open() compare(control.visible, true) + compare(control.opened, false) + compare(openedChangeSpy.count, 0) compare(openedSpy.count, 0) tryCompare(openedSpy, "count", 1) + compare(control.opened, true) + compare(openedChangeSpy.count, 1) compare(closedSpy.count, 0) control.close() + compare(control.visible, true) + compare(control.opened, false) + compare(openedChangeSpy.count, 2) compare(openedSpy.count, 1) compare(closedSpy.count, 0) tryCompare(closedSpy, "count", 1) + compare(control.opened, false) + compare(openedChangeSpy.count, 2) compare(control.visible, false) } -- cgit v1.2.3