Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P2: Important
-
Resolution: Done
-
Affects Version/s: 5.5.0
-
Fix Version/s: 5.6.0
-
Component/s: QML: Declarative and Javascript Engine
-
Labels:None
-
Commits:afbfdcff3b3cd14f16736b7c84e04fe9ad61ef8d
Description
If I expose a value type to QML using Q_GADGET, QVariant properties of the new type are not accessible from QML. Properties of other types work fine, and QVariant properties of QObject types work correctly.
I've attached a test case that demonstrates this.
This appears to be because QQmlValueTypeWrapper::get wraps the QVariant property value in a QVariant before passing it to QV4::ExecutionEngine::fromVariant, which doesn't handle this case. Indeed, the value of the property appears to be converted to a QV4::VariantObject in the engine.