PDA

View Full Version : Cannot queue arguments of type 'QStringList'



vfernandez
19th April 2006, 20:20
With QT 4.1, I'm trying to connect a signal from a worker thread (child of QThread) to a slot in a class which is a child of QWidget and pass a QStringList as the argument:


connect(m_workerThread, SIGNAL(setSystemUserNames(const QStringList&)),
this, SLOT(setSystemUserNames(const QStringList&)));

But when I run the program I get this error message and the connection isn't established:


QObject::connect: Cannot queue arguments of type 'QStringList'

Both methods in m_workerThread and the GUI class are defined as:


void setSystemUserNames(const QStringList& userNames);

I've tried changing it to simply "QStringList userNames" (so, not const&), but still get the same warning. Am I missing something? Any idea?

jacek
19th April 2006, 20:36
Try:
qRegisterMetaType<QStringList>("QStringList");

wysota
19th April 2006, 20:48
or use QVariant holding a list (QVariant(QStringList)) instead of QStringList.