Results 1 to 3 of 3

Thread: Queued Signal Slot connections

  1. #1
    Join Date
    May 2009
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Queued Signal Slot connections

    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

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Queued Signal Slot connections

    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
    "Behind every great fortune lies a crime" - Balzac

  3. #3
    Join Date
    May 2009
    Posts
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Queued Signal Slot connections

    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

Similar Threads

  1. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  2. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  3. Replies: 12
    Last Post: 18th September 2008, 15:04
  4. signal and slot across threads having event loop
    By travis in forum Qt Programming
    Replies: 6
    Last Post: 5th November 2007, 23:56
  5. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.