From 27fb50ac724020c32a6d5ee1b00b0648f689e0d1 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 21 Mar 2012 13:06:59 +0100 Subject: [PATCH] Fix doAction with custom functions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When calling invokeMethod, pass the function name without parentheses. Change-Id: I5a5a28242a98bf76347450b799c1d51c293f9ef4 Reviewed-by: Morten Johan Sørvig --- src/plugins/accessible/shared/qqmlaccessible.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/accessible/shared/qqmlaccessible.cpp b/src/plugins/accessible/shared/qqmlaccessible.cpp index 70c6b90efe..54d0c06171 100644 --- a/src/plugins/accessible/shared/qqmlaccessible.cpp +++ b/src/plugins/accessible/shared/qqmlaccessible.cpp @@ -158,9 +158,9 @@ void QQmlAccessible::doAction(const QString &actionName) { // Look for and call the accessible[actionName]Action() function on the item. // This allows for overriding the default action handling. - const QByteArray functionName = "accessible" + actionName.toLatin1() + "Action()"; - if (object()->metaObject()->indexOfMethod(functionName) != -1) { - QMetaObject::invokeMethod(object(), functionName, Q_ARG(QString, actionName)); + const QByteArray functionName = "accessible" + actionName.toLatin1() + "Action"; + if (object()->metaObject()->indexOfMethod(functionName + "()") != -1) { + QMetaObject::invokeMethod(object(), functionName); return; }