Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.7.3, 6.8.0
-
None
-
Windows 10
-
-
0a567a7f9 (dev), 4a79ed90f (6.9), 0370138e2 (6.8)
Description
We have two QML_ELEMENT classes, ClassA and ClassB in two different libraries/plugins, both in the same namespace.
ClassB has a Q_PROPERTY of type ClassA*. ClassA is forward declared in ClassB.h using Q_DECLARE_OPAQUE_POINTER.
Then ClassA and ClassB are instantiated in QML. Here the ClassB property is initialized with the ClassA instance.
When started on Windows then we get the error:
"qrc:/qt/qml/AssignmentIssue/Main.qml:18:5: Unable to assign elements::foo::bar::ClassA to elements::foo::bar::ClassA"
and the ClassB instance is not initialized correctly.
If we compile and run this code on Linux then there is no error message and both instances are initialized correctly.
See attached code example.
I don't know if it is really necessary to have two different plugins in order to reproduce this issue. This way it is close to our real world application.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-134883 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
633933,1 | Q_DECLARE_OPAQUE_POINTER: Document footgun | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: NEW | +2 | 0 |
633175,4 | Q_DECLARE_OPAQUE_POINTER: Document footgun | dev | qt/qtbase | Status: MERGED | +2 | 0 |
633897,2 | Q_DECLARE_OPAQUE_POINTER: Document footgun | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |
633909,2 | Q_DECLARE_OPAQUE_POINTER: Document footgun | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |