aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpopup.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-08-19 14:16:51 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-08-19 14:26:34 +0000
commit02d1126499c2efd58fdcdde970d0713940230c58 (patch)
tree5a826f84d461ee80358c0f8afd078ec90f970f84 /src/quicktemplates2/qquickpopup.cpp
parentccc482a2de8710a548c080e441e0658ae50fcb2e (diff)
Close parentless popups
A parentless popup is not visible anywhere, and is not even associated to a QML engine. Attempting to execute transitions would crash. Make sure to remove any event filters (when using a plain QML Window, like with QML TestCase) when a popup is made parentless. This ensures that if the global shared tooltip was shown on an item that was destroyed, the tooltip won't keep interfering with the window where it was last shown. Change-Id: I87bf9f8dda2fbcc5d1b83d1b83a66a6b9e718eb6 Task-number: QTBUG-55347 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpopup.cpp')
-rw-r--r--src/quicktemplates2/qquickpopup.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index 2af90d24..c155716c 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -1415,6 +1415,8 @@ void QQuickPopup::setParentItem(QQuickItem *parent)
p->resolveFont();
if (QQuickApplicationWindow *window = qobject_cast<QQuickApplicationWindow *>(parent->window()))
p->updateLocale(window->locale(), false); // explicit=false
+ } else {
+ close();
}
d->setWindow(parent ? parent->window() : nullptr);
emit parentChanged();