aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels/qqmllistmodel.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-07-09 13:36:07 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-07-09 21:00:03 +0200
commitc25c2b73a4689f9f4dbdbb0034db98643c8156ce (patch)
tree70c12ccdb57e585fd6d8599364b75720170b7630 /src/qmlmodels/qqmllistmodel.cpp
parentaef0aac581fbbead07be939873e34045137b94ff (diff)
StringOrTranslation::toString: fix string check
arrayData can now be null, because shared null for QString has been removed. Instead of checking for arrayData, we now check whether the stringSize is larger than 0. Change-Id: I81e683bb8394ee84b291098add3f62636a697a8d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qmlmodels/qqmllistmodel.cpp')
-rw-r--r--src/qmlmodels/qqmllistmodel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qmlmodels/qqmllistmodel.cpp b/src/qmlmodels/qqmllistmodel.cpp
index 39fdb1c582..ef305562a5 100644
--- a/src/qmlmodels/qqmllistmodel.cpp
+++ b/src/qmlmodels/qqmllistmodel.cpp
@@ -296,8 +296,9 @@ void StringOrTranslation::setTranslation(const QV4::CompiledData::Binding *bindi
QString StringOrTranslation::toString(const QQmlListModel *owner) const
{
- if (arrayData) {
- arrayData->ref();
+ if (stringSize) {
+ if (arrayData)
+ arrayData->ref();
return QString(QStringPrivate(arrayData, stringData, stringSize));
}
if (!owner)