From f615541442ea64be4350f0ba5896095de2ea45fc Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Wed, 25 Mar 2020 14:07:08 +0100 Subject: qqml.h: do not use QML_REGISTER_TYPE(QObject) This breaks code if the following circumstances all apply: - A project is compiled with CMake using AUTOMOC - It contains a class with a property of type QQmlList - In the resulting mocs_compilation.cpp, qqml.h is (transitively included). Then, a use of QMetaTypeId> will be in a single file before its definition. The use comes from the instation of qt_metaTypeArray. The explicit specialization comes from QMetaTypeID, and happens afterwards (depending on include order). gcc does not like this, and the compilation fails. There is probably no reason for QML_REGISTER_TYPE(QObject), so we just remove it. Removes the Q_DECLARE_METATYPE(QVariant), too, while we're at it. Change-Id: Ia6607c31af92dadd809633188bb82fa90efaf922 Reviewed-by: Ulf Hermann --- src/qml/qml/qqml.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index 524af7181c..76a4740101 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -879,7 +879,4 @@ int Q_QML_EXPORT qmlTypeId(const char *uri, int versionMajor, int versionMinor, QT_END_NAMESPACE -QML_DECLARE_TYPE(QObject) -Q_DECLARE_METATYPE(QVariant) - #endif // QQML_H -- cgit v1.2.3