diff options
author | Filippo Cucchetto <filippocucchetto@gmail.com> | 2015-12-04 01:34:27 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-12-07 13:41:36 +0000 |
commit | 80cde7c7ca22511494ae6d32b2023fb1e92ede4d (patch) | |
tree | c45ad49b498ccde716283675822ae674cfa5454c /src/controls/qquickmenupopupwindow.cpp | |
parent | 12f699a0a66055b70acfcc4f6c957cebf19f4504 (diff) | |
download | qtquickcontrols-80cde7c7ca22511494ae6d32b2023fb1e92ede4d.tar.gz |
Moved menuBar function from QQuickMenuPopupWindow to QQuickmenuv5.6.0-beta1
Change-Id: I6628ac2b8b07634afc1062488a12788a4e3f66c0
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls/qquickmenupopupwindow.cpp')
-rw-r--r-- | src/controls/qquickmenupopupwindow.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/controls/qquickmenupopupwindow.cpp b/src/controls/qquickmenupopupwindow.cpp index a578ea62..9385be46 100644 --- a/src/controls/qquickmenupopupwindow.cpp +++ b/src/controls/qquickmenupopupwindow.cpp @@ -168,25 +168,11 @@ QQuickMenu *QQuickMenuPopupWindow::menu() const return m_menu; } -QQuickMenuBar *QQuickMenuPopupWindow::menuBar() const -{ - QObject *pi = menu()->parentMenuOrMenuBar(); - while (pi) { - if (QQuickMenuBar *menuBar = qobject_cast<QQuickMenuBar*>(pi)) - return menuBar; - else if (QQuickMenu *menu = qobject_cast<QQuickMenu*>(pi)) - pi = menu->parentMenuOrMenuBar(); - else - return 0; - } - return 0; -} - bool QQuickMenuPopupWindow::shouldForwardEventAfterDismiss(QMouseEvent *e) const { // If the event falls inside this item the event should not be forwarded. // For example for comboboxes or top menus of the menubar - QQuickMenuBar *mb = menuBar(); + QQuickMenuBar *mb = m_menu ? m_menu->menuBar() : Q_NULLPTR; QQuickItem *item = mb && !mb->isNative() ? mb->contentItem() : menu()->visualItem(); QWindow *window = transientParent(); if (item && window && item->window() == window) { |