diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2018-04-26 19:09:32 -0700 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2018-05-03 22:51:01 +0000 |
commit | 8447f5f006287887ee2910d9710d7bd867aca6e8 (patch) | |
tree | a518c063b9f015814b84149aaeb2f70786c2ac91 /src/gui | |
parent | 93cf1cf2e59328f1d969ad1cda5ffd7531c66aef (diff) |
QShortcut: Try harder to find a widget for parentless menubars
Add QPlatformMenuBar::parentWindow(). Since we call handleReparent()
every so often, it's reasonable to be able to get its value back.
While this parent window won't give us much information from
the point of view of the actual QWidget parent for the menubar,
the main reason we will need this is to check for modality blockage.
Indeed, QApplicationPrivate::tryModalHelper() only cares about the
widget's window since modality blockage is decided at the window level.
Change-Id: Ie79f483424b01e430bc9168ba82489e30d15aec6
Task-number: QTBUG-67938
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qplatformmenu.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformmenu.h b/src/gui/kernel/qplatformmenu.h index e3fa5c71b1..28c29a704c 100644 --- a/src/gui/kernel/qplatformmenu.h +++ b/src/gui/kernel/qplatformmenu.h @@ -158,6 +158,7 @@ public: virtual void removeMenu(QPlatformMenu *menu) = 0; virtual void syncMenu(QPlatformMenu *menuItem) = 0; virtual void handleReparent(QWindow *newParentWindow) = 0; + virtual QWindow *parentWindow() const { return nullptr; } virtual QPlatformMenu *menuForTag(quintptr tag) const = 0; virtual QPlatformMenu *createMenu() const; |