aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-12-23 14:32:12 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-12-23 20:45:58 +0000
commit8cd268e994576a853bf430a6f60b94aa2767c20e (patch)
tree6b5770785ef5bd27dbe1e23ecb7c25625ad7791a /src/templates
parentf38e35dcd46bd4ac0c9859ec4f974702f6c8ad03 (diff)
ComboBox: fix displayText initialization
Make ComboBox::textAt(idx) call ObjectModel::object(idx) to force initialization of the model items. Change-Id: If99c9263fa00ae6d21a92f11a45caf6e1f6b731c Task-number: QTBUG-50143 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/qquickcombobox.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/templates/qquickcombobox.cpp b/src/templates/qquickcombobox.cpp
index 4465d5dc..a2c0bf89 100644
--- a/src/templates/qquickcombobox.cpp
+++ b/src/templates/qquickcombobox.cpp
@@ -595,7 +595,7 @@ void QQuickComboBox::setPopup(QQuickPopup *popup)
QString QQuickComboBox::textAt(int index) const
{
Q_D(const QQuickComboBox);
- if (!d->delegateModel || index < 0 || index >= d->delegateModel->count())
+ if (!d->delegateModel || index < 0 || index >= d->delegateModel->count() || !d->delegateModel->object(index))
return QString();
return d->delegateModel->stringValue(index, d->textRole.isEmpty() ? QStringLiteral("modelData") : d->textRole);
}