summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/ios/qiosmenu.h3
-rw-r--r--src/plugins/platforms/ios/qiosmenu.mm8
2 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiosmenu.h b/src/plugins/platforms/ios/qiosmenu.h
index 9897483a3e..5a153c9a06 100644
--- a/src/plugins/platforms/ios/qiosmenu.h
+++ b/src/plugins/platforms/ios/qiosmenu.h
@@ -64,7 +64,7 @@ public:
void setIcon(const QIcon &) Q_DECL_OVERRIDE {}
void setMenu(QPlatformMenu *) Q_DECL_OVERRIDE {}
void setVisible(bool isVisible) Q_DECL_OVERRIDE;
- void setIsSeparator(bool) Q_DECL_OVERRIDE {}
+ void setIsSeparator(bool) Q_DECL_OVERRIDE;
void setFont(const QFont &) Q_DECL_OVERRIDE {}
void setRole(MenuRole role) Q_DECL_OVERRIDE;
void setCheckable(bool) Q_DECL_OVERRIDE {}
@@ -78,6 +78,7 @@ public:
QString m_text;
MenuRole m_role;
bool m_enabled;
+ bool m_separator;
private:
QString removeMnemonics(const QString &original);
diff --git a/src/plugins/platforms/ios/qiosmenu.mm b/src/plugins/platforms/ios/qiosmenu.mm
index 8f7baa9756..27c747a7dc 100644
--- a/src/plugins/platforms/ios/qiosmenu.mm
+++ b/src/plugins/platforms/ios/qiosmenu.mm
@@ -215,6 +215,7 @@ QIOSMenuItem::QIOSMenuItem()
, m_text(QString())
, m_role(MenuRole(0))
, m_enabled(true)
+ , m_separator(false)
{
}
@@ -238,6 +239,11 @@ void QIOSMenuItem::setVisible(bool isVisible)
m_visible = isVisible;
}
+void QIOSMenuItem::setIsSeparator(bool isSeparator)
+{
+ m_separator = isSeparator;
+}
+
void QIOSMenuItem::setRole(QPlatformMenuItem::MenuRole role)
{
m_role = role;
@@ -487,7 +493,7 @@ QIOSMenuItemList QIOSMenu::visibleMenuItems() const
for (int i = visibleMenuItems.count() - 1; i >= 0; --i) {
QIOSMenuItem *item = visibleMenuItems.at(i);
- if (!item->m_enabled || !item->m_visible)
+ if (!item->m_enabled || !item->m_visible || item->m_separator)
visibleMenuItems.removeAt(i);
}