* QMetaType::construct() has been renamed to QMetaType::create().
* QMetaType::unregisterType() has been removed.
+- QMetaMethod::signature() has been renamed to QMetaMethod::methodSignature(),
+ and the return type has been changed to QByteArray. This was done to be able
+ to generate the signature string on demand, rather than always storing it in
+ the meta-data.
+
- QTestLib:
* The plain-text, xml and lightxml test output formats have been changed to
show a test result for every row of test data in data-driven tests. In
const QMetaObject* metaObject = obj->metaObject();
QStringList methods;
for(int i = metaObject->methodOffset(); i < metaObject->methodCount(); ++i)
- methods << QString::fromLatin1(metaObject->method(i).signature());
+ methods << QString::fromLatin1(metaObject->method(i).methodSignature());
//! [methodCount]
//! [6]
return data;
}
+static inline QByteArray toByteArray(const QByteArrayData &d)
+{
+ return QByteArray(reinterpret_cast<const QStaticByteArrayData<0> &>(d));
+}
+
static inline const char *legacyString(const QMetaObject *mo, int index)
{
Q_ASSERT(priv(mo->d.data)->revision <= 6);
\ingroup objectmodel
- A QMetaMethod has a methodType(), a signature(), a list of
+ A QMetaMethod has a methodType(), a methodSignature(), a list of
parameterTypes() and parameterNames(), a return typeName(), a
tag(), and an access() specifier. You can use invoke() to invoke
the method on an arbitrary QObject.
*/
/*!
+ \since 5.0
+
Returns the signature of this method (e.g.,
\c{setValue(double)}).
\sa parameterTypes(), parameterNames()
*/
-const char *QMetaMethod::signature() const
+QByteArray QMetaMethod::methodSignature() const
{
if (!mobj)
- return 0;
- return rawStringData(mobj, mobj->d.data[handle]);
+ return QByteArray();
+ return toByteArray(stringData(mobj, mobj->d.data[handle]));
}
/*!
Returns a list of parameter types.
- \sa parameterNames(), signature()
+ \sa parameterNames(), methodSignature()
*/
QList<QByteArray> QMetaMethod::parameterTypes() const
{
/*!
Returns a list of parameter names.
- \sa parameterTypes(), signature()
+ \sa parameterTypes(), methodSignature()
*/
QList<QByteArray> QMetaMethod::parameterNames() const
{
public:
inline QMetaMethod() : mobj(0),handle(0) {}
- const char *signature() const;
+ QByteArray methodSignature() const;
const char *typeName() const;
QList<QByteArray> parameterTypes() const;
QList<QByteArray> parameterNames() const;
inline bool isValid() const { return mobj != 0; }
private:
+#if QT_DEPRECATED_SINCE(5,0)
+ // signature() has been renamed to methodSignature() in Qt 5.
+ // Warning, that function returns a QByteArray; check the life time if
+ // you convert to char*.
+ char *signature(struct renamedInQt5_warning_checkTheLifeTime * = 0) Q_DECL_EQ_DELETE;
+#endif
+
const QMetaObject *mobj;
uint handle;
friend struct QMetaObject;
{
QMetaMethodBuilder method;
if (prototype.methodType() == QMetaMethod::Method)
- method = addMethod(prototype.signature());
+ method = addMethod(prototype.methodSignature());
else if (prototype.methodType() == QMetaMethod::Signal)
- method = addSignal(prototype.signature());
+ method = addSignal(prototype.methodSignature());
else if (prototype.methodType() == QMetaMethod::Slot)
- method = addSlot(prototype.signature());
+ method = addSlot(prototype.methodSignature());
else if (prototype.methodType() == QMetaMethod::Constructor)
- method = addConstructor(prototype.signature());
+ method = addConstructor(prototype.methodSignature());
method.setReturnType(prototype.typeName());
method.setParameterNames(prototype.parameterNames());
method.setTag(prototype.tag());
QMetaMethodBuilder QMetaObjectBuilder::addConstructor(const QMetaMethod& prototype)
{
Q_ASSERT(prototype.methodType() == QMetaMethod::Constructor);
- QMetaMethodBuilder ctor = addConstructor(prototype.signature());
+ QMetaMethodBuilder ctor = addConstructor(prototype.methodSignature());
ctor.setReturnType(prototype.typeName());
ctor.setParameterNames(prototype.parameterNames());
ctor.setTag(prototype.tag());
if (prototype.hasNotifySignal()) {
// Find an existing method for the notify signal, or add a new one.
QMetaMethod method = prototype.notifySignal();
- int index = indexOfMethod(method.signature());
+ int index = indexOfMethod(method.methodSignature());
if (index == -1)
index = addMethod(method).index();
d->properties[property._index].notifySignal = index;
if (signal.attributes() & QMetaMethod::Compatibility) {
if (!(method.attributes() & QMetaMethod::Compatibility))
qWarning("QObject::connect: Connecting from COMPAT signal (%s::%s)",
- sender->className(), signal.signature());
+ sender->className(), signal.methodSignature().constData());
} else if ((method.attributes() & QMetaMethod::Compatibility) &&
method.methodType() == QMetaMethod::Signal) {
qWarning("QObject::connect: Connecting from %s::%s to COMPAT slot (%s::%s)",
- sender->className(), signal.signature(),
- receiver->className(), method.signature());
+ sender->className(), signal.methodSignature().constData(),
+ receiver->className(), method.methodSignature().constData());
}
}
|| method.methodType() == QMetaMethod::Constructor) {
qWarning("QObject::connect: Cannot connect %s::%s to %s::%s",
sender ? sender->metaObject()->className() : "(null)",
- signal.signature(),
+ signal.methodSignature().constData(),
receiver ? receiver->metaObject()->className() : "(null)",
- method.signature() );
+ method.methodSignature().constData() );
return QMetaObject::Connection(0);
}
- // Reconstructing SIGNAL() macro result for signal.signature() string
+ // Reconstructing SIGNAL() macro result for signal.methodSignature() string
QByteArray signalSignature;
- signalSignature.reserve(qstrlen(signal.signature())+1);
+ signalSignature.reserve(signal.methodSignature().size()+1);
signalSignature.append((char)(QSIGNAL_CODE + '0'));
- signalSignature.append(signal.signature());
+ signalSignature.append(signal.methodSignature());
int signal_index;
int method_index;
const QMetaObject *rmeta = receiver->metaObject();
if (signal_index == -1) {
qWarning("QObject::connect: Can't find signal %s on instance of class %s",
- signal.signature(), smeta->className());
+ signal.methodSignature().constData(), smeta->className());
return QMetaObject::Connection(0);
}
if (method_index == -1) {
qWarning("QObject::connect: Can't find method %s on instance of class %s",
- method.signature(), rmeta->className());
+ method.methodSignature().constData(), rmeta->className());
return QMetaObject::Connection(0);
}
- if (!QMetaObject::checkConnectArgs(signal.signature(), method.signature())) {
+ if (!QMetaObject::checkConnectArgs(signal.methodSignature().constData(), method.methodSignature().constData())) {
qWarning("QObject::connect: Incompatible sender/receiver arguments"
"\n %s::%s --> %s::%s",
- smeta->className(), signal.signature(),
- rmeta->className(), method.signature());
+ smeta->className(), signal.methodSignature().constData(),
+ rmeta->className(), method.methodSignature().constData());
return QMetaObject::Connection(0);
}
if(signal.methodType() != QMetaMethod::Signal) {
qWarning("QObject::%s: Attempt to %s non-signal %s::%s",
"disconnect","unbind",
- sender->metaObject()->className(), signal.signature());
+ sender->metaObject()->className(), signal.methodSignature().constData());
return false;
}
}
if (method.mobj) {
if(method.methodType() == QMetaMethod::Constructor) {
qWarning("QObject::disconect: cannot use constructor as argument %s::%s",
- receiver->metaObject()->className(), method.signature());
+ receiver->metaObject()->className(), method.methodSignature().constData());
return false;
}
}
- // Reconstructing SIGNAL() macro result for signal.signature() string
+ // Reconstructing SIGNAL() macro result for signal.methodSignature() string
QByteArray signalSignature;
if (signal.mobj) {
- signalSignature.reserve(qstrlen(signal.signature())+1);
+ signalSignature.reserve(signal.methodSignature().size()+1);
signalSignature.append((char)(QSIGNAL_CODE + '0'));
- signalSignature.append(signal.signature());
+ signalSignature.append(signal.methodSignature());
}
int signal_index;
// is -1 then this signal is not a member of sender.
if (signal.mobj && signal_index == -1) {
qWarning("QObject::disconect: signal %s not found on class %s",
- signal.signature(), sender->metaObject()->className());
+ signal.methodSignature().constData(), sender->metaObject()->className());
return false;
}
// If this condition is true then method is not a member of receeiver.
if (receiver && method.mobj && method_index == -1) {
qWarning("QObject::disconect: method %s not found on class %s",
- method.signature(), receiver->metaObject()->className());
+ method.methodSignature().constData(), receiver->metaObject()->className());
return false;
}
Q_ASSERT(mo);
const QObjectList list = o->findChildren<QObject *>(QString());
for (int i = 0; i < mo->methodCount(); ++i) {
- const char *slot = mo->method(i).signature();
+ QByteArray slotSignature = mo->method(i).methodSignature();
+ const char *slot = slotSignature.constData();
Q_ASSERT(slot);
if (slot[0] != 'o' || slot[1] != 'n' || slot[2] != '_')
continue;
if (method.methodType() != QMetaMethod::Signal)
continue;
- if (!qstrncmp(method.signature(), slot + len + 4, slotlen)) {
+ if (!qstrncmp(method.methodSignature().constData(), slot + len + 4, slotlen)) {
int signalOffset, methodOffset;
computeOffsets(method.enclosingMetaObject(), &signalOffset, &methodOffset);
sigIndex = k + - methodOffset + signalOffset;
offset = methodOffset - signalOffset;
}
const QMetaMethod signal = metaObject()->method(signal_index + offset);
- qDebug(" signal: %s", signal.signature());
+ qDebug(" signal: %s", signal.methodSignature().constData());
// receivers
const QObjectPrivate::Connection *c =
qDebug(" --> %s::%s %s",
receiverMetaObject->className(),
c->receiver->objectName().isEmpty() ? "unnamed" : qPrintable(c->receiver->objectName()),
- method.signature());
+ method.methodSignature().constData());
c = c->nextConnectionList;
}
}
qDebug(" <-- %s::%s %s",
s->sender->metaObject()->className(),
s->sender->objectName().isEmpty() ? "unnamed" : qPrintable(s->sender->objectName()),
- slot.signature());
+ slot.methodSignature().constData());
}
} else {
qDebug(" <None>");
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": sending signal event ( sender =" << sender
- << ", signal =" << sender->metaObject()->method(signalIndex).signature() << ')';
+ << ", signal =" << sender->metaObject()->method(signalIndex).methodSignature().constData() << ')';
#endif
postInternalEvent(new QStateMachine::SignalEvent(sender, signalIndex, vargs));
processEvents(DirectProcessing);
continue;
// try to connect/disconnect to a signal on the parent that has the same method signature
- QByteArray sig = QMetaObject::normalizedSignature(mm.signature());
+ QByteArray sig = QMetaObject::normalizedSignature(mm.methodSignature().constData());
if (them->indexOfSignal(sig) == -1)
continue;
sig.prepend(QSIGNAL_CODE + '0');
// invalid signal signature
// qDBusParametersForMethod has not yet complained about this one
qWarning("QDBusAbstractAdaptor: Cannot relay signal %s::%s",
- senderMetaObject->className(), mm.signature());
+ senderMetaObject->className(), mm.methodSignature().constData());
return;
}
for (int i = staticMetaObject.methodCount(); i < mo->methodCount(); ++i) {
QMetaMethod mm = mo->method(i);
- if (QByteArray(mm.signature()).startsWith(match)) {
+ if (mm.methodSignature().startsWith(match)) {
// found a method with the same name as what we're looking for
// hopefully, nobody is overloading asynchronous and synchronous methods with
// the same name
continue;
// check name:
- QByteArray slotname = mm.signature();
+ QByteArray slotname = mm.methodSignature();
int paren = slotname.indexOf('(');
if (paren != name.length() || !slotname.startsWith(name))
continue;
QString interface = qDBusInterfaceFromMetaObject(mo);
QMetaMethod mm = mo->method(signalId);
- QByteArray memberName = mm.signature();
+ QByteArray memberName = mm.methodSignature();
memberName.truncate(memberName.indexOf('('));
// check if it's scriptable
for ( ; it != end; ++it) {
const QByteArray &type = *it;
if (type.endsWith('*')) {
- //qWarning("Could not parse the method '%s'", mm.signature());
+ //qWarning("Could not parse the method '%s'", mm.methodSignature().constData());
// pointer?
return -1;
}
int id = QMetaType::type(basictype);
if (id == 0) {
- //qWarning("Could not parse the method '%s'", mm.signature());
+ //qWarning("Could not parse the method '%s'", mm.methodSignature().constData());
// invalid type in method parameter list
return -1;
} else if (QDBusMetaType::typeToSignature(id) == 0)
}
if (seenMessage) { // && !type.endsWith('&')
- //qWarning("Could not parse the method '%s'", mm.signature());
+ //qWarning("Could not parse the method '%s'", mm.methodSignature().constData());
// non-output parameters after message or after output params
return -1; // not allowed
}
int id = QMetaType::type(type);
if (id == 0) {
- //qWarning("Could not parse the method '%s'", mm.signature());
+ //qWarning("Could not parse the method '%s'", mm.methodSignature().constData());
// invalid type in method parameter list
return -1;
}
// now add methods:
for (int i = methodOffset; i < mo->methodCount(); ++i) {
QMetaMethod mm = mo->method(i);
- QByteArray signature = mm.signature();
+ QByteArray signature = mm.methodSignature();
int paren = signature.indexOf('(');
bool isSignal;
continue;
if (!qstrcmp(member.tag(), "QACCESSIBLE_SLOT")) {
- if (member.signature() == defaultAction)
+ if (member.methodSignature() == defaultAction)
actionList.prepend(defaultAction);
else
- actionList << member.signature();
+ actionList << member.methodSignature();
}
}
static QByteArray memberName(const QMetaMethod &member)
{
- QByteArray ba = member.signature();
+ QByteArray ba = member.methodSignature();
return ba.left(ba.indexOf('('));
}
str += QByteArray::number(quintptr(caller), 16);
str += ") ";
- str += member.signature();
+ str += member.methodSignature();
qPrintMessage(str);
}
if (sl.access() != QMetaMethod::Private || !sl.parameterTypes().isEmpty()
|| qstrlen(sl.typeName()) || sl.methodType() != QMetaMethod::Slot)
return false;
- const char *sig = sl.signature();
+ QByteArray signature = sl.methodSignature();
+ const char *sig = signature.constData();
int len = qstrlen(sig);
if (len < 2)
return false;
for (int i = 0; i < QTest::currentTestObject->metaObject()->methodCount(); ++i) {
QMetaMethod sl = QTest::currentTestObject->metaObject()->method(i);
if (isValidSlot(sl))
- fprintf(stream, "%s\n", sl.signature());
+ fprintf(stream, "%s\n", sl.methodSignature().constData());
}
}
// Retrieve local tags:
QStringList localTags;
QTestTable table;
- char *slot = qstrdup(tf.signature());
+ char *slot = qstrdup(tf.methodSignature().constData());
slot[strlen(slot) - 2] = '\0';
QByteArray member;
member.resize(qstrlen(slot) + qstrlen("_data()") + 1);
if (QTest::testFuncs) {
for (int i = 0; i != QTest::testFuncCount; i++) {
- if (!qInvokeTestMethod(metaObject->method(QTest::testFuncs[i].function()).signature(),
+ if (!qInvokeTestMethod(metaObject->method(QTest::testFuncs[i].function()).methodSignature().constData(),
QTest::testFuncs[i].data())) {
break;
}
for (int i = 0; i != methodCount; i++) {
if (!isValidSlot(testMethods[i]))
continue;
- if (!qInvokeTestMethod(testMethods[i].signature()))
+ if (!qInvokeTestMethod(testMethods[i].methodSignature().constData()))
break;
}
delete[] testMethods;
QCOMPARE(method.methodType(), methodType);
QCOMPARE(method.access(), access);
- QCOMPARE(method.signature(), signature.constData());
+ QCOMPARE(method.methodSignature(), signature);
QCOMPARE(method.tag(), "");
QVERIFY(prop.isValid());
QVERIFY(prop.hasNotifySignal());
QMetaMethod signal = prop.notifySignal();
- QCOMPARE(signal.signature(), "value6Changed()");
+ QCOMPARE(signal.methodSignature(), QByteArray("value6Changed()"));
prop = mo->property(mo->indexOfProperty("value7"));
QVERIFY(prop.isValid());
QVERIFY(prop.hasNotifySignal());
signal = prop.notifySignal();
- QCOMPARE(signal.signature(), "value7Changed(QString)");
+ QCOMPARE(signal.methodSignature(), QByteArray("value7Changed(QString)"));
prop = mo->property(mo->indexOfProperty("value8"));
QVERIFY(prop.isValid());
QVERIFY(!prop.hasNotifySignal());
signal = prop.notifySignal();
- QCOMPARE(signal.signature(), (const char *)0);
+ QCOMPARE(signal.methodSignature(), QByteArray());
prop = mo->property(mo->indexOfProperty("value"));
QVERIFY(prop.isValid());
QVERIFY(!prop.hasNotifySignal());
signal = prop.notifySignal();
- QCOMPARE(signal.signature(), (const char *)0);
+ QCOMPARE(signal.methodSignature(), QByteArray());
}
void tst_QMetaObject::propertyConstant()
QFETCH(bool, isSignal);
int idx = object->metaObject()->indexOfMethod(name);
QVERIFY(idx >= 0);
- QCOMPARE(object->metaObject()->method(idx).signature(), name.constData());
+ QCOMPARE(object->metaObject()->method(idx).methodSignature(), name);
QCOMPARE(object->metaObject()->indexOfSlot(name), isSignal ? -1 : idx);
QCOMPARE(object->metaObject()->indexOfSignal(name), !isSignal ? -1 : idx);
}
static bool sameMethod(const QMetaMethod& method1, const QMetaMethod& method2)
{
- if (QByteArray(method1.signature()) != QByteArray(method2.signature()))
+ if (method1.methodSignature() != method2.methodSignature())
return false;
if (QByteArray(method1.typeName()) != QByteArray(method2.typeName()))
if (_a[0]) *reinterpret_cast<QObject**>(_a[0]) = _r; } break;
default: {
QMetaMethod ctor = _o->metaObject()->constructor(_id);
- qFatal("You forgot to add a case for CreateInstance %s", ctor.signature());
+ qFatal("You forgot to add a case for CreateInstance %s", ctor.methodSignature().constData());
}
}
} else if (_c == QMetaObject::InvokeMetaMethod) {
case 2: *reinterpret_cast<QVariantList(*)>(_a[0]) = _t->listInvokableQRealQString(*reinterpret_cast<qreal(*)>(_a[1]), *reinterpret_cast<QString(*)>(_a[2])); break;
default: {
QMetaMethod method = _o->metaObject()->method(_o->metaObject()->methodOffset() + _id);
- qFatal("You forgot to add a case for InvokeMetaMethod %s", method.signature());
+ qFatal("You forgot to add a case for InvokeMetaMethod %s", method.methodSignature().constData());
}
}
} else if (_c == QMetaObject::IndexOfMethod) {
QMetaMethod m;
m = mobj->method(mobj->indexOfMethod("invoke1()"));
- QVERIFY(QByteArray(m.signature()) == "invoke1()");
+ QVERIFY(m.methodSignature() == "invoke1()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Public);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
QVERIFY(!(m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("sinvoke1()"));
- QVERIFY(QByteArray(m.signature()) == "sinvoke1()");
+ QVERIFY(m.methodSignature() == "sinvoke1()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Public);
QVERIFY((m.attributes() & QMetaMethod::Scriptable));
QVERIFY(!(m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("invoke2()"));
- QVERIFY(QByteArray(m.signature()) == "invoke2()");
+ QVERIFY(m.methodSignature() == "invoke2()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Protected);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
QVERIFY((m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("sinvoke2()"));
- QVERIFY(QByteArray(m.signature()) == "sinvoke2()");
+ QVERIFY(m.methodSignature() == "sinvoke2()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Protected);
QVERIFY((m.attributes() & QMetaMethod::Scriptable));
QVERIFY((m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("invoke3()"));
- QVERIFY(QByteArray(m.signature()) == "invoke3()");
+ QVERIFY(m.methodSignature() == "invoke3()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Private);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
QVERIFY(!(m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("sinvoke3()"));
- QVERIFY(QByteArray(m.signature()) == "sinvoke3()");
+ QVERIFY(m.methodSignature() == "sinvoke3()");
QVERIFY(m.methodType() == QMetaMethod::Method);
QVERIFY(m.access() == QMetaMethod::Private);
QVERIFY((m.attributes() & QMetaMethod::Scriptable));
QVERIFY(!(m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("signal5()"));
- QVERIFY(QByteArray(m.signature()) == "signal5()");
+ QVERIFY(m.methodSignature() == "signal5()");
QVERIFY(m.methodType() == QMetaMethod::Signal);
QVERIFY(m.access() == QMetaMethod::Protected);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
QVERIFY((m.attributes() & QMetaMethod::Compatibility));
m = mobj->method(mobj->indexOfMethod("aPublicSlot()"));
- QVERIFY(QByteArray(m.signature()) == "aPublicSlot()");
+ QVERIFY(m.methodSignature() == "aPublicSlot()");
QVERIFY(m.methodType() == QMetaMethod::Slot);
QVERIFY(m.access() == QMetaMethod::Public);
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
for (int i = metaobject->methodOffset(); i < metaobject->methodCount(); ++i) {
QMetaMethod expected = metaobject->method(i);
- int methodIdx = result->indexOfMethod(expected.signature());
+ int methodIdx = result->indexOfMethod(expected.methodSignature().constData());
QVERIFY(methodIdx != -1);
QMetaMethod constructed = result->method(methodIdx);
QCOMPARE(mobj->methodCount() - mobj->methodOffset(), 1);
QMetaMethod mm = mobj->method(mobj->methodOffset());
- QCOMPARE(mm.signature(), "slotWithAReallyLongName(int)");
+ QCOMPARE(mm.methodSignature(), QByteArray("slotWithAReallyLongName(int)"));
}
void tst_Moc::trNoopInClassInfo()
{
const QMetaObject &mobj = InvokableBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 6);
- QVERIFY(mobj.method(5).signature() == QByteArray("foo()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()"));
}
{
const QMetaObject &mobj = InvokableBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).signature() == QByteArray("foo()"));
- QVERIFY(mobj.method(6).signature() == QByteArray("bar()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()"));
+ QVERIFY(mobj.method(6).methodSignature() == QByteArray("bar()"));
}
}
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
+ QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
+ QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordAfterInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
+ QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
+ QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
}
}
QMetaMethod mm = mo->constructor(0);
QCOMPARE(mm.access(), QMetaMethod::Public);
QCOMPARE(mm.methodType(), QMetaMethod::Constructor);
- QCOMPARE(mm.signature(), "CtorTestClass(QObject*)");
+ QCOMPARE(mm.methodSignature(), QByteArray("CtorTestClass(QObject*)"));
QCOMPARE(mm.typeName(), "");
QList<QByteArray> paramNames = mm.parameterNames();
QCOMPARE(paramNames.size(), 1);
QMetaMethod mm = mo->constructor(1);
QCOMPARE(mm.access(), QMetaMethod::Public);
QCOMPARE(mm.methodType(), QMetaMethod::Constructor);
- QCOMPARE(mm.signature(), "CtorTestClass()");
+ QCOMPARE(mm.methodSignature(), QByteArray("CtorTestClass()"));
QCOMPARE(mm.typeName(), "");
QCOMPARE(mm.parameterNames().size(), 0);
QCOMPARE(mm.parameterTypes().size(), 0);
QMetaMethod mm = mo->constructor(2);
QCOMPARE(mm.access(), QMetaMethod::Public);
QCOMPARE(mm.methodType(), QMetaMethod::Constructor);
- QCOMPARE(mm.signature(), "CtorTestClass(QString)");
+ QCOMPARE(mm.methodSignature(), QByteArray("CtorTestClass(QString)"));
QCOMPARE(mm.typeName(), "");
QList<QByteArray> paramNames = mm.parameterNames();
QCOMPARE(paramNames.size(), 1);
QMetaMethod method = subWindow->metaObject()->method(i);
if (method.methodType() == QMetaMethod::Signal) {
QString signature(QLatin1String("2"));
- signature += QLatin1String(method.signature());
+ signature += QLatin1String(method.methodSignature().constData());
numConnectedSignals += subWindow->receivers(signature.toLatin1());
}
}
const QMetaObject *mo = &QTreeView::staticMetaObject;
for (int i = 0; i < mo->methodCount(); ++i) {
QMetaMethod method = mo->method(i);
- QByteArray sig = method.signature();
+ QByteArray sig = method.methodSignature();
QTest::newRow(sig) << sig;
}
}
QMetaMethod method = mo->method(i);
if (method.methodType() != QMetaMethod::Signal)
continue;
- QByteArray sig = method.signature();
+ QByteArray sig = method.methodSignature();
QTest::newRow(sig) << sig;
}
}
QMetaMethod method = mo->method(i);
if (method.methodType() != QMetaMethod::Slot)
continue;
- QByteArray sig = method.signature();
+ QByteArray sig = method.methodSignature();
QTest::newRow(sig) << sig;
}
}