From 4dd4c442e15a155ff3784f28d6c1ebc68fe8382e Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 5 Mar 2012 08:31:00 +0100 Subject: Adapt to Qt5 meta-object changes QMetaMethod::signature() has been renamed to methodSignature(), and it now returns a QByteArray. Also, the new function QMetaMethod::isValid() should be used to determine whether a method is valid, instead of relying on signature() returning a 0 pointer. Where it makes sense, the existing code that was using signature() and parameterTypes() has been changed to use the new API QMetaMethod::name(), parameterCount(), and parameterType(int). Also, in the new meta-object revision (7), the QMetaObject stringdata member is now of type QByteArrayData*. QFastMetaBuilder will be ported to generate the new format, but for now it's sufficient to reinterpret_cast the stringdata assignment to keep it compiling. Change-Id: Ie340ef17bcebc3afa4aae6450dfe2d06e4d881a4 Reviewed-by: Aaron Kennedy --- tools/qmlplugindump/main.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'tools') diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index cea29158f9..b3cc721bd4 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -386,10 +386,10 @@ public: // for QObject, hide deleteLater() and onDestroyed for (int index = meta->methodOffset(); index < meta->methodCount(); ++index) { QMetaMethod method = meta->method(index); - const char *signature(method.signature()); - if (signature == QLatin1String("destroyed(QObject*)") - || signature == QLatin1String("destroyed()") - || signature == QLatin1String("deleteLater()")) + QByteArray signature = method.methodSignature(); + if (signature == QByteArrayLiteral("destroyed(QObject*)") + || signature == QByteArrayLiteral("destroyed()") + || signature == QByteArrayLiteral("deleteLater()")) continue; dump(method, implicitSignals); } @@ -500,12 +500,7 @@ private: return; // nothing to do. } - QByteArray name = meth.signature(); - int lparenIndex = name.indexOf('('); - if (lparenIndex == -1) { - return; // invalid signature - } - name = name.left(lparenIndex); + QByteArray name = meth.name(); const QString typeName = convertToId(meth.typeName()); if (implicitSignals.contains(name) -- cgit v1.2.3