aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2012-06-21 16:02:38 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-21 08:36:51 +0200
commit73e0e7cd53d2ce457d2cab02895eb253902c555a (patch)
treefe019056c5b86dc733f1b44c0f9daadccc6ef012 /src
parent09b605ddcc33575316211156ff5979aa92e7e1fd (diff)
Disallow signal-handler-specification for non-signal methods
Previously, the code which checked whether a signal handler specification was valid was incorrect, in that it only checked that a method of the appropriate name existed (rather than specifically a signal method). This commit ensures that the appropriate code is updated to check the method for signal-ness. Task-number: QTBUG-26223 Change-Id: I306f6622aaa710d86c01d5bbc5146eecce7cf2c3 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlcompiler.cpp2
-rw-r--r--src/qml/qml/qqmlproperty.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp
index 71c5bdcfbe..5df02d0bc1 100644
--- a/src/qml/qml/qqmlcompiler.cpp
+++ b/src/qml/qml/qqmlcompiler.cpp
@@ -3812,7 +3812,7 @@ QQmlCompiler::signal(QQmlScript::Object *object, const QHashedStringRef &name, b
if (d && !cache->isAllowedInRevision(d)) {
if (notInRevision) *notInRevision = true;
return 0;
- } else if (d) {
+ } else if (d && d->isSignal()) {
return d;
}
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index 945f6de5c0..33f860fb17 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -1870,7 +1870,7 @@ QMetaMethod QQmlPropertyPrivate::findSignalByName(const QMetaObject *mo, const Q
for (int ii = methods - 1; ii >= 2; --ii) { // >= 2 to block the destroyed signal
QMetaMethod method = mo->method(ii);
- if (method.name() == name)
+ if (method.name() == name && (method.methodType() & QMetaMethod::Signal))
return method;
}