Skip to content

Commit

Permalink
Fix doAction with custom functions.
Browse files Browse the repository at this point in the history
When calling invokeMethod, pass the function name without parentheses.

Change-Id: I5a5a28242a98bf76347450b799c1d51c293f9ef4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
  • Loading branch information
Frederik Gladhorn authored and Qt by Nokia committed Mar 21, 2012
1 parent 63f1fb2 commit 27fb50a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/accessible/shared/qqmlaccessible.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 27fb50a

Please sign in to comment.