diff options
author | J-P Nurmi <jpnurmi@gmail.com> | 2016-03-19 08:05:57 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-21 19:54:18 +0000 |
commit | 9d590d6313ba579a2c2112e4b314cacd05d09a50 (patch) | |
tree | 40994563221d7eafc1a113cbe316243bdd18014d /tests/auto/popup | |
parent | 5e162c68fade8e5d4175deb92496376bd7be43d7 (diff) |
Change the default value of QQuickPopup::closePolicy
When Popup::ClosePolicy was introduced, I thought that it would be
better to not set OnPressOutside by default, because not all popups
necessarily want to close on press outside. However, I've realized
that every time I do
Button {
onClicked: popup.open()
Popup { }
}
...there's literally no interactive way to close the popup (popups
don't take focus by default, so Esc doesn't work).
Provided that a top-level QWidget with the Qt::Popup flag set also
closes automatically on press outside, it probably makes more sense
for us to follow the same pattern so that poor new users don't have
to lookup the docs just to figure out how to make a popup close. :)
In this case it's less troublesome to specify a different default
value in those special scenarios/subclasses where closing on press
outside is not desired (eg. the upcoming Popup-based Drawer).
Change-Id: Iaeab4c548d63728df12232d8b65d469f0a2d80f5
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/popup')
-rw-r--r-- | tests/auto/popup/tst_popup.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/tests/auto/popup/tst_popup.cpp b/tests/auto/popup/tst_popup.cpp index da772384..ae886623 100644 --- a/tests/auto/popup/tst_popup.cpp +++ b/tests/auto/popup/tst_popup.cpp @@ -129,11 +129,6 @@ void tst_popup::overlay() QCOMPARE(overlayPressedSignal.count(), 2); QCOMPARE(overlayReleasedSignal.count(), 1); - QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier, QPoint(button->x() + popup->x() + popup->width() / 2, - button->y() + popup->y() + popup->height() / 2)); - QCOMPARE(overlayPressedSignal.count(), 2); - QCOMPARE(overlayReleasedSignal.count(), 1); - QVERIFY(!popup->isVisible()); } |