I'm porting FitNesse Slim server at the moment and I'm stuck right now. What I get are these lines:
("id_4", "call", "id", "setNumerator", "20") ("id_5", "call", "id", "setSomethingElse", "10", "8")
Where "setNumerator" and "setSomethingElse" are the names of the methods that should be called, and "20", "10" and "8" are the arguments that I pass. So, my problem right now, I do not know how to use one invokeMethod call for both methods. My current workaround is as follows:
//(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)))
etc.
Therefore, on the one hand, it seems that every invokeMethod call requires very specific information, which makes it difficult with a variable number of arguments. On the other hand, there must be a way, so I do not need to do the same two (or later: ten) times. So the question is, is there any other way to do this with a single call?