summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-01-25 12:00:35 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-01-25 12:00:43 +0100
commitc220203787f7b30d69d9102165dc5d09bc2ac5b6 (patch)
tree2c1e4b5ee01a37082417faa0295202364ae2a995
parentb834f742994e5dce69c3fdc161099f2ed20deff9 (diff)
parenta33fe70970d891e096fff6a84d7e0c02f8ee978a (diff)
downloadqtquickcontrols-c220203787f7b30d69d9102165dc5d09bc2ac5b6.tar.gz
Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: I434c0d9c03200ff9ad0abc336c87ea52ea5abd67
-rw-r--r--src/controls/qquickmenupopupwindow.cpp7
-rw-r--r--src/controls/qquickmenupopupwindow_p.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/controls/qquickmenupopupwindow.cpp b/src/controls/qquickmenupopupwindow.cpp
index 8d821d84..670ad6aa 100644
--- a/src/controls/qquickmenupopupwindow.cpp
+++ b/src/controls/qquickmenupopupwindow.cpp
@@ -148,6 +148,13 @@ void QQuickMenuPopupWindow::updatePosition()
setGeometry(newPos.x(), newPos.y(), width(), height());
}
+void QQuickMenuPopupWindow::focusInEvent(QFocusEvent *e)
+{
+ QQuickWindow::focusInEvent(e);
+ if (m_menu && m_menu->menuContentItem())
+ m_menu->menuContentItem()->forceActiveFocus();
+}
+
void QQuickMenuPopupWindow::exposeEvent(QExposeEvent *e)
{
// the popup will reposition at the last moment, so its
diff --git a/src/controls/qquickmenupopupwindow_p.h b/src/controls/qquickmenupopupwindow_p.h
index 5cff75af..abee1f83 100644
--- a/src/controls/qquickmenupopupwindow_p.h
+++ b/src/controls/qquickmenupopupwindow_p.h
@@ -68,6 +68,7 @@ Q_SIGNALS:
void willBeDeletedLater();
protected:
+ void focusInEvent(QFocusEvent *);
void exposeEvent(QExposeEvent *);
bool shouldForwardEventAfterDismiss(QMouseEvent *) const;