PDA

View Full Version : Queued Signal Slot connections



SebastianBecker
13th June 2009, 17:03
Hello,

I have a question concerning queued signal slot connections for interthread communication. With builtin Qt-types everything works fine. When I try to use some custom data classes as parameters it also works on Windows XP, but on Windows CE I get access violations when I emit the signal. I have registered my custom datatype with qRegisterMetaType and Q_DECLARE_METATYPE. Has anyone had experience with Qt 4.5.x and Windows CE here?

Kind regards,
Sebastian

wagmare
15th June 2009, 12:01
signals and slots over thread use queued connection ..
there trick is to use Q_DECLARE_METATYPE and qregisterMetaType

* with queued connection , the parameter must be of types that are known to qt's meta object system .

*because qt needs to copy the arguments to store them in event behind the scene

if error came :


QObject::connect:cannot queue argument with 'mtype'


call QRegisterMetaType() to register the data type before connection is established ..

have a good day

SebastianBecker
24th June 2009, 20:06
Hi there.

Thats exactly what I already did. And it works with Windows XP. The same code does not work for Windows CE.

Any other suggestions?

Cheers,
Sebastian