Android: Support popup menus
This is used by QML comboboxes, menu buttons, etc. Task-number: QTBUG-31420 Change-Id: I6d3f32fd80ce91c4be34eae636d1b95a4e251a49 Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
parent
770a0c91f3
commit
63824d2e00
@ -141,6 +141,15 @@ bool QAndroidPlatformMenu::isVisible() const
|
|||||||
return m_isVisible;
|
return m_isVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QAndroidPlatformMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatformMenuItem *item)
|
||||||
|
{
|
||||||
|
Q_UNUSED(parentWindow);
|
||||||
|
Q_UNUSED(pos);
|
||||||
|
Q_UNUSED(item);
|
||||||
|
setVisible(true);
|
||||||
|
QtAndroidMenu::showContextMenu(this);
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformMenuItem *QAndroidPlatformMenu::menuItemAt(int position) const
|
QPlatformMenuItem *QAndroidPlatformMenu::menuItemAt(int position) const
|
||||||
{
|
{
|
||||||
if (position < m_menuItems.size())
|
if (position < m_menuItems.size())
|
||||||
@ -154,7 +163,6 @@ QPlatformMenuItem *QAndroidPlatformMenu::menuItemForTag(quintptr tag) const
|
|||||||
if (menuItem->tag() == tag)
|
if (menuItem->tag() == tag)
|
||||||
return menuItem;
|
return menuItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ public:
|
|||||||
bool isEnabled() const;
|
bool isEnabled() const;
|
||||||
void setVisible(bool visible);
|
void setVisible(bool visible);
|
||||||
bool isVisible() const;
|
bool isVisible() const;
|
||||||
|
void showPopup(const QWindow *parentWindow, QPoint pos, const QPlatformMenuItem *item);
|
||||||
|
|
||||||
QPlatformMenuItem *menuItemAt(int position) const;
|
QPlatformMenuItem *menuItemAt(int position) const;
|
||||||
QPlatformMenuItem *menuItemForTag(quintptr tag) const;
|
QPlatformMenuItem *menuItemForTag(quintptr tag) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user