PDA

View Full Version : Cannot queue...



vratojr
9th May 2006, 15:15
Hello,I'm writing a multithread application.
I have an object that I have to pass in a slot between two threads.
I have registered the object:


qRegisterMetaType<ExchangeAction>("ExchangeAction");


And I'd like to pass the object as a reference (ExchangeAction&) but I got the error that is not possible to queue it. Why?

thanks!

wysota
9th May 2006, 15:18
What does ExchangeAction look like? You probably need to provide methods to serialise and deserialise it to be able to queue it.

EDIT:


Any class or struct that has a public constructor, a public copy constructor, and a public destructor can be registered.

Does ExchangeAction have all those?

You could also take a look at void qRegisterMetaTypeStreamOperators ( const char * typeName ).

vratojr
9th May 2006, 15:59
What does ExchangeAction look like? You probably need to provide methods to serialise and deserialise it to be able to queue it.

EDIT:

Any class or struct that has a public constructor, a public copy constructor, and a public destructor can be registered.

Does ExchangeAction have all those?


Hi,thank for your reply.
The class is a very simple class and it has what is needed. In fact I CAN register it.
I can pass a ExchangeAction in a slot but not an ExchangeAction&.



You could also take a look at void qRegisterMetaTypeStreamOperators ( const char * typeName ).

Thanks but I don't need it.

jacek
9th May 2006, 16:06
I can pass a ExchangeAction in a slot but not an ExchangeAction&
I don't think it's possible to queue a reference. If you need to modify that object in a slot, try sending a pointer.