PDA

View Full Version : qRegisterMetaType and own class



^NyAw^
9th January 2008, 10:44
Hi,

I have my own class and I need to send objects of this class by SIGNALs SLOTs mechanism.
Now I'm using it without registering my class with "qRegisterMetaType (file:///C:/Qt/4.3.0/doc/html/qmetatype.html#qRegisterMetaType)" and passing the parameters as value(not references), but I don't have developed the copy constructor. It seems to work, could this produce any problems?

Thanks,

wysota
9th January 2008, 11:42
It shouldn't unless you try to send signals across threads. Then Qt will (or at least should) not let you do this.

^NyAw^
9th January 2008, 12:06
Hi,

And doing this with timers? I use a timer that makes "polling". When "timeout" is triggered it call the slot that make some job and this slot emits a signal that contain an object of my class.

Thanks,

wysota
9th January 2008, 12:20
As long as signal arguments don't need to be serialized, there is nothing to worry about. Of course registering the meta type wouldn't hurt :)