Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.0.0 Beta4
-
None
-
Windows 10
Visual Studio 2019
-
-
b4c17476129e07dd3bf52c6aac8a51cf30c2dd3a (qt/qtbase/dev)
Description
When adding a QQmlComponent as a Q_PROPERTY I have the following issue on windows with msvc compiler:
/FoSources\Engine\Canvas\CMakeFiles\EngineCanvas.dir\EngineCanvas_autogen\mocs_compilation.cpp.obj /FdSources\Engine\Canvas\CMakeFiles\EngineCanvas.dir\ /FS -c Sources\Engine\Canvas\EngineCanvas_autogen\mocs_compilation.cpp C:\Qt\6.0.0\msvc2019_64\include\QtCore/qmetatype.h(2261): error C2187: syntax error: ';' was unexpected here C:\Qt\6.0.0\msvc2019_64\include\QtCore/qmetatype.h(2261): note: while compiling class template static data member 'const QtPrivate::QMetaTypeInterface QtPrivate::QMetaTypeInterfaceWrapper<Ty>::metaType' C:\Qt\6.0.0\msvc2019_64\include\QtCore/qmetatype.h(2317): note: see reference to class template instantiation 'QtPrivate::QMetaTypeInterfaceWrapper<Ty>' being compiled C:\Qt\6.0.0\msvc2019_64\include\QtCore/qmetatype.h(2378): note: see reference to function template instantiation 'const QtPrivate::QMetaTypeInterface *QtPrivate::qMetaTypeInterfaceForType<T>(void)' being compiled with [ T=QQmlComponent * ] C:\Qt\6.0.0\msvc2019_64\include\QtCore/qmetatype.h(1125): note: see reference to function template instantiation 'QMetaType QMetaType::fromType<T>(void)' being compiled with [ T=QQmlComponent * ] C:\Qt\6.0.0\msvc2019_64\include\QtCore/qmetatype.h(1149): note: see reference to function template instantiation 'int qRegisterNormalizedMetaType<T>(const QByteArray &)' being compiled with [ T=QQmlComponent * ] C:\Qt\6.0.0\msvc2019_64\include\QtQml/qqmlcomponent.h(165): note: see reference to function template instantiation 'int qRegisterMetaType<QQmlComponent*>(const char *)' being compiled
Edit:
As mentioned in the comment below: the issue seems to comes from including the QQuickItem header. I've added a very basic cmake + main that cause the issue.