From c3858bd53974e486e03537d1937deb0020828556 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 24 Jan 2018 13:44:00 +0100 Subject: QQuickComboBox: fix popup's deferred execution Unlike other delegates, such as background and contentItem, popup is not unconditionally executed upon component completion. For performance reasons, its execution is delayed until the popup is needed, that is, the popup is accessed or shown. When the popup is accessed, we use the current completion status via isComponentComplete() to determine whether its execution must be completed immediately, or if we can wait until componentComplete(). However, if the popup was accessed while the combobox itself was being completed (used in ComboBox's bindings), the popup was never completed because isComponentComplete() was still returning false even though the popup was actually being indirectly accessed from componentComplete(). A simple execution order change, to complete the combobox itself before the popup, fixes the problem. Task-number: QTBUG-65962 Change-Id: I4764eb7e273e7f6fa1dab1a65a02b87722ee7cba Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickcombobox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp index fb10730e..55ff0e55 100644 --- a/src/quicktemplates2/qquickcombobox.cpp +++ b/src/quicktemplates2/qquickcombobox.cpp @@ -1603,9 +1603,9 @@ void QQuickComboBox::componentComplete() { Q_D(QQuickComboBox); d->executeIndicator(true); + QQuickControl::componentComplete(); if (d->popup) d->executePopup(true); - QQuickControl::componentComplete(); if (d->delegateModel && d->ownModel) static_cast(d->delegateModel)->componentComplete(); -- cgit v1.2.3