diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-11-04 16:45:17 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-11-09 11:43:52 +0000 |
commit | d6e03b3837f369e9fc94915ef3ad649903845382 (patch) | |
tree | f149ae27a60495e2bb5952c01a4cc92a2998828a /src/imports/controls/ComboBox.qml | |
parent | 372c5b44e5bc2730c3557cf56bffc5496ab020f3 (diff) |
QQuickComboBox: ensure a parent for delegates
This allows us to replace the "width: control.popup.width" expressions
with "width: parent.width" to avoid explicit references to the popup.
Next, we are ready to defer the execution of the popup until it becomes
visible or is accessed by the user.
Without the parent item fix, ComboBox throws an error:
ComboBox.qml:58: TypeError: Cannot read property of null
...and tst_snippets fails => tested implicitly. :)
Change-Id: Ib9cfcf7558addbe3403d835d3ae11b6c11c2f0cb
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/imports/controls/ComboBox.qml')
-rw-r--r-- | src/imports/controls/ComboBox.qml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 6c85dd58..c400441d 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -55,7 +55,7 @@ T.ComboBox { //! [delegate] delegate: ItemDelegate { - width: control.popup.width + width: parent.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal highlighted: control.highlightedIndex == index |