foreach
makes a copy of passed container. QSignalSpy
inherits QObject
hence it cannot be copied. These two facts cause the error.
The simpliest workaround is to use usual for
loop. You can also create a non-QObject copy of the list and use it to iterate:
QList< QList<QVariant> > list = mySignalSpy;
foreach( const QList<QVariant> &args, list ) {
//...
}