summaryrefslogtreecommitdiffstats
path: root/src/controls/qquickmenu_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-11-17 14:04:59 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-11-17 15:46:14 +0000
commit61db1507f30082c661c46410115ca74f74842ca7 (patch)
tree453a3ac408f8eeda25c3d9560b723c1ec3204f86 /src/controls/qquickmenu_p.h
parent0f3f31334485dab7ff21a01c14f9411c05901f2b (diff)
Fix proxy menu crash
Mobile-centric ApplicationWindowStyle implementations (Flat & Android) use a proxy menu to morph menubar items into a single menu button. The items are owned by the menubar and must not be deleted by the proxy menu. Otherwise, depending on the destruction order, the items would get deleted twice. Change-Id: I92d0c45fc3274574fd1edf34d8d3d081990f2727 Task-number: QTBUG-48927 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/controls/qquickmenu_p.h')
-rw-r--r--src/controls/qquickmenu_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/controls/qquickmenu_p.h b/src/controls/qquickmenu_p.h
index 1c51fe716..f49f6d623 100644
--- a/src/controls/qquickmenu_p.h
+++ b/src/controls/qquickmenu_p.h
@@ -70,6 +70,7 @@ class QQuickMenu : public QQuickMenuText
Q_PROPERTY(qreal __yOffset READ yOffset WRITE setYOffset)
Q_PROPERTY(QQuickAction *__action READ action CONSTANT)
Q_PROPERTY(QRect __popupGeometry READ popupGeometry NOTIFY __popupGeometryChanged)
+ Q_PROPERTY(bool __isProxy READ isProxy WRITE setProxy NOTIFY __proxyChanged)
Q_ENUMS(MenuType)
public:
@@ -106,6 +107,7 @@ Q_SIGNALS:
void __popupGeometryChanged();
void menuContentItemChanged();
void minimumWidthChanged();
+ void __proxyChanged();
public:
QQuickMenu(QObject *parent = 0);
@@ -142,6 +144,9 @@ public:
QRect popupGeometry() const;
+ bool isProxy() const { return m_proxy; }
+ void setProxy(bool proxy) { if (m_proxy != proxy) { m_proxy = proxy; emit __proxyChanged(); } }
+
void prepareItemTrigger(QQuickMenuItem *);
void concludeItemTrigger(QQuickMenuItem *);
void destroyMenuPopup();
@@ -196,6 +201,7 @@ private:
qreal m_yOffset;
QFont m_font;
int m_triggerCount;
+ bool m_proxy;
};
QT_END_NAMESPACE