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>bb10
parent
eb122a6fe4
commit
98f0b46689
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue