diff options
author | Filippo Cucchetto <filippocucchetto@gmail.com> | 2015-12-24 11:03:22 +0100 |
---|---|---|
committer | Filippo Cucchetto <filippocucchetto@gmail.com> | 2016-01-24 15:01:27 +0000 |
commit | a33fe70970d891e096fff6a84d7e0c02f8ee978a (patch) | |
tree | aec5af4a46bfe92d8fd4302c921029c9403a045b /src/controls/qquickmenupopupwindow_p.h | |
parent | 1836451c18c557dbfc332124ef4645b3ba2bc9d4 (diff) | |
download | qtquickcontrols-a33fe70970d891e096fff6a84d7e0c02f8ee978a.tar.gz |
Fixed keyboard navigation in submenus
This bug was due to a couple of factors interacting:
1) the QQuickMenu::__popupVisible property is not in sync with the
popupWindow::visible property. In fact, the QQuickMenu::__popupVisible
becomes true before the PopupWindow::Show() method is called.
2) In the Menu.qml file, the menu content item is created through the user
of Loader, whose active property becomes true when the
QQuickMenu::__popupVisible property is true. So the result is that the
MenuContentItem is created before the QQuickPopupWindow is effectively
visible.
3) Given point (2), the MenuContentItem requests focus on creation (since
it has focus: true). However, given (1), the QQuickPopupWindow is
neither visible nor active.
This patch addresses this problem by forcing activeFocus to the
menuContentItem only when the popupWindow gets focus.
Task-number: QTBUG-41951
Change-Id: I095700726aab4ac45a62cd37b33a069e294df30e
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls/qquickmenupopupwindow_p.h')
-rw-r--r-- | src/controls/qquickmenupopupwindow_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/controls/qquickmenupopupwindow_p.h b/src/controls/qquickmenupopupwindow_p.h index 8c10f255..fb96dc74 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; |