diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-05-21 12:19:15 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-27 07:53:01 +0200 |
commit | 7a5f70d6e5037334813db938eb0f4a646df512e9 (patch) | |
tree | 5d5c1c124e3e479ff243364b84615113106d690d /src/qml/qml/qqmlscriptstring.cpp | |
parent | 201c4fb670239a0c153d5c95dbfed0ee3a2ec243 (diff) |
Fix QQmlScriptString::isEmpty for script strings without source code
The source code is not strictly required anymore and QQmlScriptString should
return true with isEmpty() if the object is conceptually empty (not usable),
not only when the source code is empty. It can still have a valid binding id
and thus be used in QQmlExpression.
Change-Id: I777717f2217d0c46e059c382761a1044881c5978
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlscriptstring.cpp')
-rw-r--r-- | src/qml/qml/qqmlscriptstring.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlscriptstring.cpp b/src/qml/qml/qqmlscriptstring.cpp index fd710df52f..af9d8ec265 100644 --- a/src/qml/qml/qqmlscriptstring.cpp +++ b/src/qml/qml/qqmlscriptstring.cpp @@ -126,7 +126,9 @@ Returns whether the QQmlScriptString is empty. */ bool QQmlScriptString::isEmpty() const { - return d->script.isEmpty(); + if (!d->script.isEmpty()) + return false; + return d->bindingId == -1; } /*! |