
Originally Posted by
jpn
Thanks, I noticed there was an existing thread when I received my subscriber email from QT regarding this thread. After looking at the existing thread on this subject I was able to get it working. I use the following which succeeds:
qRegisterMetaType<QStringList>("QStringList");
SIGNAL(removeGamesSignal (int, const QStringList& )),
m_pkr_receiver_class,
SLOT(invokeGamesRemoval (int, const QStringList& )),
Qt::QueuedConnection);
qRegisterMetaType<QStringList>("QStringList");
QObject::connect (m_emitter_class,
SIGNAL(removeGamesSignal (int, const QStringList& )),
m_pkr_receiver_class,
SLOT(invokeGamesRemoval (int, const QStringList& )),
Qt::QueuedConnection);
To copy to clipboard, switch view to plain text mode
I did not try the QVariant option mentioned in the previous thread since it seems like a matter of personal preference. If anyone disagrees please let me know why.

Originally Posted by
wysota
Essentially you can't pass non-const references to a queued connection (as it doesn't make any sense). You'd have to use const QStringList& instead (but you wouldn't be able to change its contents). Using pointers is tricky too, because only a pointer is copied when the signal is emitted. If "in the meantime" (before the slot is executed) you delete the object, you'll end up with an invalid pointer and a possible segfault.
Thanks for the explanation of what is going on under the covers with signals I appreciate that. I'm trying to learn what the Signals/Slots are doing as far as when they copy data, etc.
Thanks, wysota, jpn, and munna.
Bookmarks