How do I use a foreach
loop on a QSignalSpy
?
This is what I want to do:
foreach( const QList<QVariant> &args, mySignalSpy )
{
Q_ASSERT( args.count() == 2 );
QVariant arg0 = args[0];
QVariant arg1 = args[1];
doSomething( arg0, arg1 );
}
This is the error I get:
/usr/local/Trolltech/Qt-4.8.2-shared/include/QtTest/qsignalspy.h: In instantiation of ‘QForeachContainer<T>::QForeachContainer(const T&) [with T = QSignalSpy]’:
MyTester.cxx:843:64: required from here
/usr/local/Trolltech/Qt-4.8.2-shared/include/QtCore/qobject.h:333:5: error: ‘QObject::QObject(const QObject&)’ is private