I am using PySide (Python Qt binding).
I have a worker thread of class QThread that updates the main GUI thread (updates the QTableWidget) through signal/slot mechanism.
In my worker thread, I have the following:
self.emit(SIGNAL("alterTable(object"), params)
In my GUI thread I have this:
self.connect(self.worker, SIGNAL("alterTable(object)"), self.updateMainTable, Qt.AutoConnection)
Since there are several similar worker threads running all connecting to the same slot (the self.updateMainTable
), I should use the AutoConnection (and consequently the QueuedConnection). Using the Qt.DirectConnection
works, but it is not safe (or so I have been told).
But when I try to use the AutoConnection, I get the following error:
QObject::connect: Cannot queue arguments of type 'object'
(Make sure 'object' is registered using qRegisterMetaType().)
I have Googled for eons trying to figure out a way how to use the qRegisterMetaType()
in PySide, to no avail. All the resources I found online point to a C++ syntax/documentation.
If it makes any difference, the object in question is a dict
most of the time.