Commit 27fb50ac authored by Frederik Gladhorn's avatar Frederik Gladhorn Committed by Qt by Nokia

Fix doAction with custom functions.

When calling invokeMethod, pass the function name without parentheses.

Change-Id: I5a5a28242a98bf76347450b799c1d51c293f9ef4
Reviewed-by: 's avatarMorten Johan Sørvig <morten.sorvig@nokia.com>
parent 63f1fb2d
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment