aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlproperty.cpp
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-03-05 08:31:00 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-13 12:58:48 +0100
commit4dd4c442e15a155ff3784f28d6c1ebc68fe8382e (patch)
treee3220da00e3cc22a3a0cfad855db69e2adf8a376 /src/qml/qml/qqmlproperty.cpp
parent4338b35c71060c33e7b0dd026a52b8d845d0b8d4 (diff)
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 <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r--src/qml/qml/qqmlproperty.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index 00cb65d106..86e18229ef 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -333,7 +333,7 @@ void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name)
signalName[0] = signalName.at(0).toLower();
QMetaMethod method = findSignalByName(currentObject->metaObject(), signalName.toLatin1().constData());
- if (method.signature()) {
+ if (method.isValid()) {
object = currentObject;
core.load(method);
return;
@@ -1707,7 +1707,7 @@ bool QQmlProperty::connectNotifySignal(QObject *dest, const char *slot) const
QMetaProperty prop = d->object->metaObject()->property(d->core.coreIndex);
if (prop.hasNotifySignal()) {
- QByteArray signal(QByteArray("2") + prop.notifySignal().signature());
+ QByteArray signal(QByteArray("2") + prop.notifySignal().methodSignature());
return QObject::connect(d->object, signal.constData(), dest, slot);
} else {
return false;
@@ -1813,11 +1813,8 @@ QMetaMethod QQmlPropertyPrivate::findSignalByName(const QMetaObject *mo, const Q
int methods = mo->methodCount();
for (int ii = methods - 1; ii >= 2; --ii) { // >= 2 to block the destroyed signal
QMetaMethod method = mo->method(ii);
- QByteArray methodName = method.signature();
- int idx = methodName.indexOf('(');
- methodName = methodName.left(idx);
- if (methodName == name)
+ if (method.name() == name)
return method;
}