aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickcontrol_p_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-26 13:35:13 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-26 14:38:00 +0000
commit0e3636a4692c9cf89d994f3fe5c1c110b4c6ee61 (patch)
tree35a6cce16c40ba0cde663ff8c41086d19b527dc9 /src/quicktemplates2/qquickcontrol_p_p.h
parent11b066beb45e7da084c6f792cf9421d48d4b40bf (diff)
Create contentItem lazily where possible
The existence of a content item is obligatory for such controls that alias the contentData and contentChildren properties to the data and children properties of the content item. Even though we created empty content items in QML to ensure one always exists, it did not not guarantee that a content item would exist for custom styles. Furthermore, the empty content item was unnecessarily created and destroyed when the property was overridden for a customized control in QML. This change creates the content item lazily where required, ensuring that it always exists even for custom styles, but does not create it in case a content item is supplied from QML. Task-number: QTBUG-54347 Task-number: QTBUG-56038 Change-Id: I714ef4f8c366f0f449b922b2c16c0ec653fbd364 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickcontrol_p_p.h')
-rw-r--r--src/quicktemplates2/qquickcontrol_p_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickcontrol_p_p.h b/src/quicktemplates2/qquickcontrol_p_p.h
index 64f29986..26760510 100644
--- a/src/quicktemplates2/qquickcontrol_p_p.h
+++ b/src/quicktemplates2/qquickcontrol_p_p.h
@@ -88,6 +88,8 @@ public:
void resizeBackground();
virtual void resizeContent();
+ virtual QQuickItem *getContentItem();
+
#ifndef QT_NO_ACCESSIBILITY
void accessibilityActiveChanged(bool active) override;
QAccessible::Role accessibleRole() const override;