aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickmenu.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-12-15 12:34:03 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-12-19 09:35:21 +0000
commitf5c13e141c9c9bf7b131da6948ebcfc01d82f160 (patch)
tree3f5e6d409612f36f230a7bb4e3eefc08940cca7e /src/quicktemplates2/qquickmenu.cpp
parent6b89293b99e763589181fd1f75470712f52cee3c (diff)
Popups: use deferred execution
QQuickPopup is backed by a QQuickControl subclass aka QQuickPopupItem. However, since the QML engine sees "background" and "contentItem" as properties of QQuickPopup, we must ensure that the deferred properties are executed for the QQuickPopup wrapper object. Task-number: QTBUG-50992 Change-Id: I2ec055b382e41530a6f4a740cb80853c0181c21a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickmenu.cpp')
-rw-r--r--src/quicktemplates2/qquickmenu.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickmenu.cpp b/src/quicktemplates2/qquickmenu.cpp
index 52c048a6..13c738ac 100644
--- a/src/quicktemplates2/qquickmenu.cpp
+++ b/src/quicktemplates2/qquickmenu.cpp
@@ -38,6 +38,7 @@
#include "qquickmenu_p_p.h"
#include "qquickmenuitem_p.h"
#include "qquickcontrol_p_p.h"
+#include "qquickpopupitem_p_p.h"
#include <QtGui/qevent.h>
#include <QtQml/private/qqmlobjectmodel_p.h>
@@ -449,6 +450,8 @@ QVariant QQuickMenu::contentModel() const
QQmlListProperty<QObject> QQuickMenu::contentData()
{
Q_D(QQuickMenu);
+ if (!d->contentItem)
+ QQuickControlPrivate::get(d->popupItem)->executeContentItem();
return QQmlListProperty<QObject>(this, d,
QQuickMenuPrivate::contentData_append,
QQuickMenuPrivate::contentData_count,