summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/moc/generator.cpp8
-rw-r--r--src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp6
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 7754771332..cc43ca4490 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -1016,7 +1016,7 @@ void Generator::generateMetacall()
fprintf(out, " if (_id < %d)\n", int(methodList.size()));
if (methodsWithAutomaticTypesHelper(methodList).isEmpty())
- fprintf(out, " *reinterpret_cast<int*>(_a[0]) = -1;\n");
+ fprintf(out, " *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType();\n");
else
fprintf(out, " qt_static_metacall(this, _c, _id, _a);\n");
fprintf(out, " _id -= %d;\n }", int(methodList.size()));
@@ -1177,13 +1177,13 @@ void Generator::generateStaticMetacall()
if (!methodsWithAutomaticTypes.isEmpty()) {
fprintf(out, " else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {\n");
fprintf(out, " switch (_id) {\n");
- fprintf(out, " default: *reinterpret_cast<int*>(_a[0]) = -1; break;\n");
+ fprintf(out, " default: *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType(); break;\n");
QMap<int, QMultiMap<QByteArray, int> >::const_iterator it = methodsWithAutomaticTypes.constBegin();
const QMap<int, QMultiMap<QByteArray, int> >::const_iterator end = methodsWithAutomaticTypes.constEnd();
for ( ; it != end; ++it) {
fprintf(out, " case %d:\n", it.key());
fprintf(out, " switch (*reinterpret_cast<int*>(_a[1])) {\n");
- fprintf(out, " default: *reinterpret_cast<int*>(_a[0]) = -1; break;\n");
+ fprintf(out, " default: *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType(); break;\n");
auto jt = it->begin();
const auto jend = it->end();
while (jt != jend) {
@@ -1191,7 +1191,7 @@ void Generator::generateStaticMetacall()
const QByteArray &lastKey = jt.key();
++jt;
if (jt == jend || jt.key() != lastKey)
- fprintf(out, " *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< %s >(); break;\n", lastKey.constData());
+ fprintf(out, " *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType::fromType< %s >(); break;\n", lastKey.constData());
}
fprintf(out, " }\n");
fprintf(out, " break;\n");
diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
index a99ac6a7c2..a8532f7003 100644
--- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
+++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
@@ -104,7 +104,7 @@ static QString addFunction(const FunctionDef &mm, bool isSignal = false) {
isSignal ? "signal" : "method", mm.name.constData());
// check the return type first
- int typeId = QMetaType::type(mm.normalizedType.constData());
+ int typeId = QMetaType::fromName(mm.normalizedType).id();
if (typeId != QMetaType::Void) {
if (typeId) {
const char *typeName = QDBusMetaType::typeToSignature(typeId);
@@ -158,7 +158,7 @@ static QString addFunction(const FunctionDef &mm, bool isSignal = false) {
// do we need to describe this argument?
if (QDBusMetaType::signatureToType(signature) == QMetaType::UnknownType) {
- const char *typeName = QMetaType::typeName(types.at(j));
+ const char *typeName = QMetaType(types.at(j)).name();
xml += QString::fromLatin1(" <annotation name=\"org.qtproject.QtDBus.QtTypeName.%1%2\" value=\"%3\"/>\n")
.arg(isOutput ? QLatin1String("Out") : QLatin1String("In"))
.arg(isOutput && !isSignal ? j - inputCount : j - 1)
@@ -208,7 +208,7 @@ static QString generateInterfaceXml(const ClassDef *mo)
if (!mp.write.isEmpty())
access |= 2;
- int typeId = QMetaType::type(mp.type.constData());
+ int typeId = QMetaType::fromName(mp.type).id();
if (!typeId) {
fprintf(stderr, PROGRAMNAME ": unregistered type: '%s', ignoring\n",
mp.type.constData());
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
index c7c08adb9b..48a0d91adb 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
@@ -246,7 +246,7 @@ static QByteArray qtTypeName(const QString &signature, const QDBusIntrospection:
return std::move(qttype).toLatin1();
}
- return QVariant::typeToName(QVariant::Type(type));
+ return QMetaType(type).name();
}
static QString nonConstRefArg(const QByteArray &arg)