[PyKDE] Signal and Slot Design problem.

Phil Thompson phil at riverbankcomputing.co.uk
Tue Jan 9 08:53:52 GMT 2007


On Monday 08 January 2007 10:52 pm, Ole Morten Grodås wrote:
> Hi,
>
> I have some problems with the signal and slots mechanism in threaded
> applications. The problem appears when the QObject.connect() call have to
> be made in another thread then the receiving slot. One example is if I have
> a worker thread that dynamically creates other worker threads. When I make
> the connect() call in the worker thread and connect to a slot that for
> example adds items to a QWidgetList I get the following error:
>
> QObject::connect: Cannot queue arguments of type 'QModelIndex'
> (Make sure 'QModelIndex' is registed using qRegisterMetaType().)

Where did the QModelIndex that you passed as the argument come from? Was it 
returned from a Qt method or did you call the ctor yourself?

I'm guessing the former - in which case add "QModelIndex()" somewhere in your 
application's initialisation. It will make the call to qRegisterMetaType().

Phil




More information about the PyQt mailing list