aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-12-13 17:34:52 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-12-14 07:16:44 +0000
commitaf0abc24e3e07917177f1a72af559db7eb15d9f4 (patch)
tree89a98d9b37ebef2f10c9349fd853ec8567643a5f /src
parent3ec6d04d976249d162f6ec92666d9008f4c21c34 (diff)
Pane: use deferred execution
Task-number: QTBUG-50992 Change-Id: Ibba0e79f8eaf76336dad3708606484a2846b2912 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquickpane.cpp10
-rw-r--r--src/quicktemplates2/qquickpane_p.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickpane.cpp b/src/quicktemplates2/qquickpane.cpp
index b89131c4..2425b865 100644
--- a/src/quicktemplates2/qquickpane.cpp
+++ b/src/quicktemplates2/qquickpane.cpp
@@ -114,6 +114,8 @@ QQuickItem *QQuickPanePrivate::getContentItem()
{
Q_Q(QQuickPane);
if (!contentItem)
+ executeContentItem();
+ if (!contentItem)
return new QQuickItem(q);
return contentItem;
}
@@ -235,6 +237,14 @@ QQmlListProperty<QQuickItem> QQuickPane::contentChildren()
QQuickItemPrivate::children_clear);
}
+void QQuickPane::componentComplete()
+{
+ Q_D(QQuickPane);
+ d->executeBackground(true);
+ d->executeContentItem(true);
+ QQuickControl::componentComplete();
+}
+
void QQuickPane::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem)
{
QQuickControl::contentItemChange(newItem, oldItem);
diff --git a/src/quicktemplates2/qquickpane_p.h b/src/quicktemplates2/qquickpane_p.h
index 759c59d8..651a8589 100644
--- a/src/quicktemplates2/qquickpane_p.h
+++ b/src/quicktemplates2/qquickpane_p.h
@@ -62,6 +62,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPane : public QQuickControl
Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged FINAL)
Q_PROPERTY(QQmlListProperty<QObject> contentData READ contentData FINAL)
Q_PROPERTY(QQmlListProperty<QQuickItem> contentChildren READ contentChildren NOTIFY contentChildrenChanged FINAL)
+ Q_CLASSINFO("DeferredPropertyNames", "background,contentItem")
Q_CLASSINFO("DefaultProperty", "contentData")
public:
@@ -84,6 +85,8 @@ Q_SIGNALS:
protected:
QQuickPane(QQuickPanePrivate &dd, QQuickItem *parent);
+ void componentComplete() override;
+
void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
#if QT_CONFIG(accessibility)