diff options
Diffstat (limited to 'src/templates/qquickcombobox.cpp')
-rw-r--r-- | src/templates/qquickcombobox.cpp | 2 |
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); } |