diff options
author | BogDan Vatra <bogdan@kde.org> | 2013-11-18 10:31:42 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-18 19:26:21 +0100 |
commit | 98f0b4668999d677d8bf91d57ac095d96e7a661c (patch) | |
tree | b2183bf06e4b9942a1b8fed11ee6d9182c37e82a | |
parent | eb122a6fe4de5b95acb287f92c6ca5e81864b1c6 (diff) |
Android: Use native platform menus.
This is an Android only patch, a proper implementation
will be pushed soon to stable branch.
Task-number: QTBUG-29462
Task-number: QTBUG-33588
Change-Id: I3447c523b4533a768d7f95e4ae60541b09a7944f
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
-rw-r--r-- | src/widgets/widgets/qmenu.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 3a4fd449c8..0cbd1c720c 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1834,6 +1834,14 @@ QSize QMenu::sizeHint() const void QMenu::popup(const QPoint &p, QAction *atAction) { Q_D(QMenu); + +#ifdef Q_OS_ANDROID + if (!d->platformMenu.isNull() && !testAttribute(Qt::WA_SetStyle)) { + d->platformMenu->showPopup(window()->windowHandle(), p, 0); + return; + } +#endif + if (d->scroll) { // reset scroll state from last popup if (d->scroll->scrollOffset) d->itemsDirty = 1; // sizeHint will be incorrect if there is previous scroll |