summaryrefslogtreecommitdiff
path: root/src/controls/ComboBox.qml
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2013-03-13 17:06:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-13 17:11:40 +0100
commit69b773c2ec5c3dfcd2d2f4b1136884de7585e742 (patch)
tree6e0a1835b819afbed93674af851fe2468ee594fe /src/controls/ComboBox.qml
parentf7b4a4c1de88d23d7e131bc6ba9565108ec35710 (diff)
downloadqtquickcontrols-69b773c2ec5c3dfcd2d2f4b1136884de7585e742.tar.gz
ComboBox: Fix rebuildMenu
Change-Id: I4c0da3ae03341438bcde7b9a80ef3324a59c5010 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/controls/ComboBox.qml')
-rw-r--r--src/controls/ComboBox.qml6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml
index 5a991d30..e76e1f5a 100644
--- a/src/controls/ComboBox.qml
+++ b/src/controls/ComboBox.qml
@@ -153,10 +153,12 @@ Control {
}
var isNumberModel = typeof(model) === "number"
- modelSize = isNumberModel ? model : (model.count || model.length)
+ var modelMayHaveRoles = model.count !== undefined
+ modelSize = isNumberModel ? model :
+ modelMayHaveRoles ? model.count : model.length
var effectiveTextRole = textRole
if (effectiveTextRole === ""
- && model.count !== undefined
+ && modelMayHaveRoles
&& model.get && model.get(0)) {
// No text role set, check whether model has a suitable role
// If 'text' is found, or there's only one role, pick that.