I´m porting FitNesse´s Slim-server at the moment and I´m kinda stuck right now.
What I´m getting are strings like these:
("id_4", "call", "id", "setNumerator", "20")
("id_5", "call", "id", "setSomethingElse", "10", "8")
Where "setNumerator" and "setSomethingElse" are the names of methods that should be invoked and "20","10" and "8" are the arguments that I´m passing.
So my problem right now ist, I don´t know how to use one call to invokeMethod for both methods. My current workaround looks like this:
//(if instructionLength==5)
metaObj->invokeMethod(className, methodName.toAscii().constData(), Qt::DirectConnection,
Q_ARG(QVariant, instructions.at(index).at(4)))
//(if instructionLength==6)
metaObj->invokeMethod(className, methodName.toAscii().constData(), Qt::DirectConnection, Q_RETURN_ARG(QVariant, retArg),
Q_ARG(QVariant, instructions.at(index).at(4)),
Q_ARG(QVariant, instructions.at(index).at(5)))
and so on...
So on the one hand, it seems that every invokeMethod-call needs very specific information, which makes it hard to do it with a variable amount of arguments. On the other hand, there has to be a way so I don´t have to do the same thing two(or later: ten) times.
So the question is, is there another way to do it with one call?