From 3ec6d04d976249d162f6ec92666d9008f4c21c34 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 13 Dec 2017 13:35:52 +0100 Subject: ComboBox: use deferred execution As a special case, ComboBox defers the execution of the popup until the popup is either accessed or made visible. This gives a nice boost in creation time benchmarks (20->25, ~25%). The old optimization of setting the delegate model only when the popup is visible is no longer needed. Task-number: QTBUG-50992 Change-Id: Ifeaceb759ab676bb54c6bc09dc97810eade72ca1 Reviewed-by: Mitch Curtis --- src/imports/controls/material/ComboBox.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/imports/controls/material/ComboBox.qml') diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index da9fd73c..d2ca7679 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -84,7 +84,7 @@ T.ComboBox { enabled: control.editable autoScroll: control.editable - readOnly: control.popup.visible + readOnly: control.down inputMethodHints: control.inputMethodHints validator: control.validator @@ -161,7 +161,7 @@ T.ComboBox { contentItem: ListView { clip: true implicitHeight: contentHeight - model: control.popup.visible ? control.delegateModel : null + model: control.delegateModel currentIndex: control.highlightedIndex highlightRangeMode: ListView.ApplyRange highlightMoveDuration: 0 @@ -171,7 +171,7 @@ T.ComboBox { background: Rectangle { radius: 2 - color: control.popup.Material.dialogColor + color: parent.Material.dialogColor layer.enabled: control.enabled layer.effect: ElevationEffect { -- cgit v1.2.3