Hi,
Is it possible to use Q_ARG with reference types? For example:
void foo(QIODevice& obj)
{
QMetaObject::invokeMethod(this,
"fooImpl", Q_ARG
(QIODevice
&, obj
));
}
void foo(QIODevice& obj)
{
QMetaObject::invokeMethod(this, "fooImpl", Q_ARG(QIODevice&, obj));
}
To copy to clipboard, switch view to plain text mode
This code does not compile because the template type for QArgument is inferred to be QIODevice&, and the QArgument constructor wants a pointer to this type (something like QIODevice&*). Is there a way around this other than simply not using reference types?
Bookmarks