Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.0, 6.1
-
c3999f96536ac359ba94d80755230e85238d578a
Description
Assume that class Parent exists in QML module A, and has a revisioned property revProp.
If class Child in module B derives from Parent, the revisioned property is inaccessible in its instances in QML, no matter which version of B gets imported.
The reason for this is that when looking for the QML type corresponding to Parent's metaobject in QQmlMetaType::qmlType, we won't accept the the version from module A (as t.availableInVersion(module, version) will only accept the type if it is found in B).
Using qmlRegisterAnonymousType, the type can be made available in module B, too. However, that method registers the type in revision 0. Consequently,
QQmlMetaTypeData::propertyCache will not call setAllowedRevision with the correct revision, and revProp is still unavailable.
Using QML_ANONYMOUS + QML_FOREIGN remedies the issue, but requires some manual work. The correct solution is most likely that qmltyperegistrar checks whether parent exists in the current module, and generates the QML_ANONYMOUS automatically if it is not.
Attachments
Issue Links
- resulted from
-
QTBUG-88179 "FileDialogDelegate.icon" is not available in QtQuick.Controls.impl 255.255
-
- Closed
-
For Gerrit Dashboard: QTBUG-90521 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
331375,1 | qmltyperegistrar: Resolve foreign types earlier | dev | qt/qtdeclarative | Status: ABANDONED | +1 | 0 |