diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-11-04 11:10:23 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-11-04 13:36:27 +0000 |
commit | 7aea777a8f4303a67cfadb0586c1fa2e71b3bd90 (patch) | |
tree | eaad1f31b01c08da7b24c3a1d1a0b4b83fe2c4d9 /src | |
parent | 83cbe4e899d2d22e923bdc10e90f91ef106edf58 (diff) |
Default: prepare ComboBox for deferred popup execution
The plan is to defer the QML execution of the whole ComboBox popup
until the popup is made visible or accessed by the user. This can
slice off roughly half of the creation time.
The QML engine refuses to defer the execution if there are any child
objects that have an identifier, because those child objects could be
referenced from outside the deferred/missing parent object. For this
reason, we must kill the unnecessary ID. This change alone does not
defer anything, but is a prerequisite for enabling deferred execution
later.
Flickable overrides Item's default property to flickableData, which
ensures that children get re-parented to Flickable::contentItem, but
ListView overrides the default property back to Item::data, so the
parent assignment is not necessary at all. The rest can be done by
referencing parent instead of the ID.
The other styles do not have ID's within the popup.
Change-Id: Iac58bae7e99252fb03bed2228153483300901720
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/controls/ComboBox.qml | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 46dc7525..720bb534 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -113,7 +113,6 @@ T.ComboBox { bottomMargin: 6 contentItem: ListView { - id: listview clip: true implicitHeight: contentHeight model: control.popup.visible ? control.delegateModel : null @@ -123,9 +122,8 @@ T.ComboBox { Rectangle { z: 10 - parent: listview - width: listview.width - height: listview.height + width: parent.width + height: parent.height color: "transparent" border.color: Default.frameLightColor } |