diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2016-04-14 16:39:09 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2016-04-20 12:59:16 +0000 |
commit | b1629a78d8e8ce031d92e42d66684e2b34630d6f (patch) | |
tree | 867d486fa0e0bf3517592ae4c0169a5f6f5ab877 /tests/auto/controls/data/tst_popup.qml | |
parent | 0fac79414ef44ff944ff45b8cc0a3c19fcce88c5 (diff) |
Popup: add opened() and closed() signals.
The only alternative at the moment is to use onVisibleChanged.
Change-Id: Ica56a30cc9895681005be0bad7b19fd205b79232
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_popup.qml')
-rw-r--r-- | tests/auto/controls/data/tst_popup.qml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index 05340d18..b361e1a8 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -923,4 +923,34 @@ TestCase { control.destroy() } + + SignalSpy { + id: openedSpy + signalName: "opened" + } + + SignalSpy { + id: closedSpy + signalName: "closed" + } + + function test_openedClosed() { + var control = popupControl.createObject(testCase) + verify(control) + + openedSpy.target = control + closedSpy.target = control + + control.open() + verify(control.visible) + compare(openedSpy.count, 1) + compare(closedSpy.count, 0) + + control.close() + verify(!control.visible) + compare(openedSpy.count, 1) + compare(closedSpy.count, 1) + + control.destroy() + } } |