Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.0.0
-
None
-
Latest qtbase/qjsbackend/qtdeclarative
-
Change-Id: Ifa891a017690a36bd5837bc6b4dd0e47eb515a46
Description
The automatic conversion from JavaScript objects to QVariantMaps fails if the object is empty.
Say you've a Q_PROPERTY of type QVariantMap:
Q_PROPERTY(QVariantMap options READ options WRITE setOptions NOTIFY optionsChanged)
which is exposed to QML/JS. Assigning a different value to 'options' will only work if the JavaScript object isn't empty, e.g.
backend.options = { "one": "two" }
works while
backend.options = {}
results in an exception/error: "Error: Cannot assign null to QVariantMap"