Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.7.0
-
None
-
0e3636a4692c9cf89d994f3fe5c1c110b4c6ee61
Description
Container controls such as Pane and its subclasses should create the default content item lazily, instantiating it only if needed. Now they all have declared an empty item in QML:
contentItem: Item { }
just to ensure that the default property contentData has always an item to forward the data to. However, the default content item is unnecessarily created when someone writes:
Pane { contentItem: ColumnLayout { ... } }
Affected controls:
$ git grep "contentItem: Item { }"
src/imports/controls/Drawer.qml: contentItem: Item { }
src/imports/controls/Frame.qml: contentItem: Item { }
src/imports/controls/GroupBox.qml: contentItem: Item { }
src/imports/controls/Page.qml: contentItem: Item { }
src/imports/controls/Pane.qml: contentItem: Item { }
src/imports/controls/Popup.qml: contentItem: Item { }
src/imports/controls/ToolBar.qml: contentItem: Item { }
src/imports/controls/material/Drawer.qml: contentItem: Item { }
src/imports/controls/material/Frame.qml: contentItem: Item { }
src/imports/controls/material/Page.qml: contentItem: Item { }
src/imports/controls/material/Pane.qml: contentItem: Item { }
src/imports/controls/material/Popup.qml: contentItem: Item { }
src/imports/controls/material/ToolBar.qml: contentItem: Item { }
src/imports/controls/universal/Drawer.qml: contentItem: Item { }
src/imports/controls/universal/Frame.qml: contentItem: Item { }
src/imports/controls/universal/GroupBox.qml: contentItem: Item { }
src/imports/controls/universal/Page.qml: contentItem: Item { }
src/imports/controls/universal/Pane.qml: contentItem: Item { }
src/imports/controls/universal/Popup.qml: contentItem: Item { }
src/imports/controls/universal/ToolBar.qml: contentItem: Item { }
Attachments
Issue Links
- relates to
-
QTBUG-54347 Runtime error when used custom popup based on QQuickPopup from Quick Controls 2
- Closed
For Gerrit Dashboard: QTBUG-56038 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
172019,3 | Create contentItem lazily where possible | 5.8 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |