Hello, I've been doing some experimenting with Qt6's QML - C++ integration (qtdeclarative @ 3d23912b0e, following the docs on providing attached properties for a QML exposed class and I'd got the aforementioned compile error.
I have the C++ class(es) in a dynamic library where in the CMakeLists.txt I've added the absolute minimum: qt_add_qml_module(TscCore URI TscCore VERSION ${TSC_VERSION} ) The code which causes the error is very bare-bones; it basically follows the documentation's examples. The classes are in a namespace, but I don't believe that's the actual cause for the error. Here's a very condensed snippet of the declarations: #include <QtQml/qqmlregistration.h> TSC_BEGIN_NAMESPACE class TSCCORE_API SimulationAttachedType : public QObject { Q_OBJECT QML_ANONYMOUS public: ... }; class TSCCORE_API Simulation : public QObject { Q_OBJECT Q_DISABLE_COPY(Simulation) QML_ATTACHED(SimulationAttachedType) QML_UNCREATABLE("") QML_NAMED_ELEMENT(Simulation) ... }; TSC_END_NAMESPACE With a bit of sifting through the headers the error goes away if I include QtQml/qqmlprivate.h. After that the integration part works just fine, the objects are available and the attached properties accessible. So, did I stumble on a bug? Kind regards, Konstantin.
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest