From 6d17b2f946004f1009c85bb27bd91a5b52c0022c Mon Sep 17 00:00:00 2001
From: Caroline Chao <caroline.chao@digia.com>
Date: Tue, 14 May 2013 08:44:55 +0200
Subject: [PATCH] ComboBox: Fix warning when model not ready

Task-number: QTBUG-31135

Change-Id: I0d9b0a3cf9d1036e6940e10944c711cdd23d858a
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
---
 src/controls/ComboBox.qml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml
index 03db9c641..219dc3b36 100644
--- a/src/controls/ComboBox.qml
+++ b/src/controls/ComboBox.qml
@@ -146,7 +146,7 @@ Control {
 
         Instantiator {
             id: popupItems
-            active: popup.ready
+            active: false
             MenuItem {
                 text: popup.textRole === '' ?
                         modelData :
@@ -157,11 +157,14 @@ Control {
             }
             onObjectAdded: popup.insertItem(index, object)
             onObjectRemoved: popup.removeItem(object)
+
         }
 
         function resolveTextValue(initialTextRole) {
-            if (!ready || !model)
+            if (!ready || !model) {
+                popupItems.active = false
                 return;
+            }
 
             var get = model['get'];
             if (!get && popup.__modelIsArray) {
@@ -192,6 +195,7 @@ Control {
                     textRole = roleName
                 }
             }
+            popupItems.active = true
         }
 
         function show() {
-- 
GitLab