Hi

I have 2 classes, A and B, derived from QObject, each have a property
of type pointer-to-other-class. So

class A : public QObject {
Q_PROPERTY(B *foo …)
…
};

And:

class B : public QObject {
Q_PROPERTY(A *foo …)
…
};

Because of the circular dependency, I can’t #include the full class
definition, just do forward declaration.

Now this fails in Qt 6, seems the moc generated code needs the 
full class declaration.

Looking at generated moc code, looks like creating the meta object
requires a qt_metaTypeArray<A*, bool> which checks that A derives
from QObject by calling  IsPointerToTypeDerivedFromQObject
which uses sizeof() which requires the full type.

Any way around this? Seems like a rather big regression compared
to Qt 5…


Mike

—
Mike Krus | [email protected] | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to