In my Qt 5.6 program I need to connect QMenu
Click (QAction
) to function and provide some arguments. I can connect to function without arguments and it is working:
connect(MyAction, &QAction::triggered, function);
But, when I'm trying to add some arguments:
connect(MyAction, &QAction::triggered, function(arguments));
I'm getting an error:
C2664: "QMetaObject::Connection QObject::connect(const QObject *,const char *,const char ,Qt::ConnectionType) const": can't convery arg 2 from "void (__thiscall QAction:: )(bool)" to "const char *"
My example function:
void fuction(char x, char y, int z);
Thank you for any advice.