aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqml.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-03-25 14:07:08 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-03-25 13:47:33 +0000
commitf615541442ea64be4350f0ba5896095de2ea45fc (patch)
tree77ac684df4a78048a4a6184a065047e11bad832e /src/qml/qml/qqml.h
parent3f0c9122c5971090d0256bda4e9fb53da4a76ea0 (diff)
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<QObject> - In the resulting mocs_compilation.cpp, qqml.h is (transitively included). Then, a use of QMetaTypeId<QQmlList<QObject>> 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 <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqml.h')
-rw-r--r--src/qml/qml/qqml.h3
1 files changed, 0 insertions, 3 deletions
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