aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpopup.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-05-10 12:44:15 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-05-11 20:34:14 +0000
commiteb6e122c68333382309843ad96e7d04d2c5a3595 (patch)
treee0bcabf84ae8822382d17b802445f5b456580ad5 /src/quicktemplates2/qquickpopup.cpp
parent25ef915acd941f0c8db3f7102a2deeaab17e6d14 (diff)
Popup: restore focus to contentItem of ApplicationWindow when closing
In Controls2, Popup and normal content are in same window, then we should maintain the focus restore work. Task-number: QTBUG-53275 Change-Id: I57f5aaf3febf1b7d2071c1734d8561932f95c699 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpopup.cpp')
-rw-r--r--src/quicktemplates2/qquickpopup.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index 0f2e8378..baa4bd8a 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -232,6 +232,12 @@ void QQuickPopupPrivate::finalizeExitTransition(bool hide)
popupItem->setVisible(false);
}
+ QQuickApplicationWindow *applicationWindow = qobject_cast<QQuickApplicationWindow*>(window);
+ if (applicationWindow)
+ applicationWindow->contentItem()->setFocus(true);
+ else if (window)
+ window->contentItem()->setFocus(true);
+
visible = false;
emit q->visibleChanged();
emit q->closed();