From c630cfa58e4f9b11ac82e687a2eaaf31946bf20e Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Mon, 13 May 2024 02:38:37 +0000 Subject: [PATCH] sync: from linuxdeepin/dtkcore Synchronize source files from linuxdeepin/dtkcore. Source-pull-request: https://github.com/linuxdeepin/dtkcore/pull/414 --- tools/qdbusxml2cpp/qdbusxml2cpp.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index 2b8c5de..d9fc3aa 100644 --- a/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -717,12 +717,20 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf for (const QString &annotation : annotations) { if (annotation.indexOf('<') != -1) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + cs << " if (QMetaType::fromName(\"" << annotation << "\").id() == QMetaType::UnknownType) {" << endl; +#else cs << " if (QMetaType::type(\"" << annotation << "\") == QMetaType::UnknownType) {" << endl; +#endif cs << " qRegisterMetaType< " << annotation << " >(\"" << annotation << "\");" << endl; cs << " qDBusRegisterMetaType< " << annotation << " >();" << endl; cs << " }" << endl; } else { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + cs << " if (QMetaType::fromName(\"" << annotation << "\").id() == QMetaType::UnknownType)" << endl; +#else cs << " if (QMetaType::type(\"" << annotation << "\") == QMetaType::UnknownType)" << endl; +#endif cs << " register" << annotation << "MetaType();" << endl; } }