slot with variable arguments
Hello, I am trying to create a slot method that has variable arguments. The MOC'er does its thing but when the compiler runs it complains about syntax.
error 2059 : syntax error : '('
Code:
Q_OBJECT
public slots:
void log(char *, ...);
};
MOC'ed code (snipped)
Code:
int Utility
::qt_metacall(QMetaObject::Call _c,
int _id,
void **_a
) { //...
case 0: log((*reinterpret_cast<const char *(*)>(_a[1])), (*reinterpret_cast< (*)>(_a[2]))); break;
//...
}
It looks like the MOC'er doesn't know how to handle '...'. Is there a better way to do this?
Thanks!
Re: slot with variable arguments
Slots can't use varargs. You can use QVariantList to pass a variable number of different types of arguments.