diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-07-09 13:36:07 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-07-09 21:00:03 +0200 |
commit | c25c2b73a4689f9f4dbdbb0034db98643c8156ce (patch) | |
tree | 70c12ccdb57e585fd6d8599364b75720170b7630 /src/qmlmodels/qqmllistmodel.cpp | |
parent | aef0aac581fbbead07be939873e34045137b94ff (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.cpp | 5 |
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) |