diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-06-21 19:16:11 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-22 11:36:52 +0000 |
commit | 697658ab9a6f68cd76a5cd2bb8185b2a6ab06844 (patch) | |
tree | f7e3369bef29ef684123da99a4867ae5cc1b295c /tests | |
parent | 1ffede10a0b2d2f0dc64fcce4f54263d9d30e57e (diff) |
Add Popup::enabled
[ChangeLog][Controls][Popup] Added "enabled" property.
Change-Id: Icc1b2be2a0e73c392189efcd67167da4177cbe9e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/popup/tst_popup.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/popup/tst_popup.cpp b/tests/auto/popup/tst_popup.cpp index 1b4f0aca..0193b769 100644 --- a/tests/auto/popup/tst_popup.cpp +++ b/tests/auto/popup/tst_popup.cpp @@ -79,6 +79,7 @@ private slots: void cursorShape(); void componentComplete(); void closeOnEscapeWithNestedPopups(); + void enabled(); }; void tst_popup::initTestCase() @@ -906,6 +907,26 @@ void tst_popup::closeOnEscapeWithNestedPopups() QCOMPARE(stackView->depth(), 1); } +void tst_popup::enabled() +{ + QQuickPopup popup; + QVERIFY(popup.isEnabled()); + QVERIFY(popup.popupItem()->isEnabled()); + + QSignalSpy enabledSpy(&popup, &QQuickPopup::enabledChanged); + QVERIFY(enabledSpy.isValid()); + + popup.setEnabled(false); + QVERIFY(!popup.isEnabled()); + QVERIFY(!popup.popupItem()->isEnabled()); + QCOMPARE(enabledSpy.count(), 1); + + popup.popupItem()->setEnabled(true); + QVERIFY(popup.isEnabled()); + QVERIFY(popup.popupItem()->isEnabled()); + QCOMPARE(enabledSpy.count(), 2); +} + QTEST_MAIN(tst_popup) #include "tst_popup.moc" |