summaryrefslogtreecommitdiff
path: root/src/controls/Private
diff options
context:
space:
mode:
authorFilippo Cucchetto <filippocucchetto@gmail.com>2015-08-17 17:10:35 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2016-01-29 11:10:32 +0000
commit4998538c94ed8cb029b8849a60b3f7528eae8311 (patch)
treebba17e65f3142e4645ab0f79c26ab108c26130bb /src/controls/Private
parenta33fe70970d891e096fff6a84d7e0c02f8ee978a (diff)
downloadqtquickcontrols-4998538c94ed8cb029b8849a60b3f7528eae8311.tar.gz
Fixed key event propagation with submenus
When a menu receive a Key_Right event and its subMenu popupwindow is already visible, the event should be discarded. In this way the event can forwarded up to the menubar for moving to the next root menu. Change-Id: Ifeb402f66fdac9fcf3a541456b929d11d36ad00d Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls/Private')
-rw-r--r--src/controls/Private/MenuContentItem.qml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/controls/Private/MenuContentItem.qml b/src/controls/Private/MenuContentItem.qml
index a0b346c4..c208e093 100644
--- a/src/controls/Private/MenuContentItem.qml
+++ b/src/controls/Private/MenuContentItem.qml
@@ -138,9 +138,13 @@ Loader {
Keys.onRightPressed: {
var item = content.menuItemAt(__menu.__currentIndex)
- if ((event.accepted = (item && item.styleData.type === MenuItemType.Menu))) {
+ if (item && item.styleData.type === MenuItemType.Menu
+ && !item.__menuItem.__popupVisible) {
item.__showSubMenu(true)
item.__menuItem.__currentIndex = 0
+ event.accepted = true
+ } else {
+ event.accepted = false
}
}