diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-12-20 18:58:10 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-01-21 08:40:33 +0000 |
commit | 0b863bca305ad43b3c48287ec4e62e262c8e8849 (patch) | |
tree | db0e7a1f2ae4aed7ee7cc66351ecc04d719cbff7 /src/quick/util/qquickpropertychanges.cpp | |
parent | 9d0ce63d3297bbc1ecfb29b26ffafa80d6a28fb0 (diff) |
QML: Special case null as binding type
This gives us the opportunity to map the JavaScript null to QVariant's
concept of isNull().
[ChangeLog][QML] Assigning JavaScript null to incompatibly typed
properties generates a compile error now, rather than a runtime error.
Fixes: QTBUG-72098
Change-Id: I72fd1c30d84128c774230eaaea10455b2a0e064c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/util/qquickpropertychanges.cpp')
-rw-r--r-- | src/quick/util/qquickpropertychanges.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp index 8e2ac32ace..d739c8a017 100644 --- a/src/quick/util/qquickpropertychanges.cpp +++ b/src/quick/util/qquickpropertychanges.cpp @@ -336,6 +336,9 @@ void QQuickPropertyChangesPrivate::decodeBinding(const QString &propertyPrefix, case QV4::CompiledData::Binding::Type_Boolean: var = binding->valueAsBoolean(); break; + case QV4::CompiledData::Binding::Type_Null: + var = QVariant::fromValue(nullptr); + break; default: break; } |