Results 1 to 2 of 2

Thread: Gui and non-Gui thread problem

  1. #1
    Join Date
    May 2009
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Gui and non-Gui thread problem

    Hi

    I am working on QtC++ (version 4.4.). I am trying to post an event from non-gui thread to gui thread. For most of cases it works fine but don't know why for one particular case its generating error saying:


    QObject::connect: Cannot queue arguments of type 'QItemSelection'
    (Make sure 'QItemSelection' is registered using qRegisterMetaType().)
    QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
    QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread


    Please suggest.

  2. #2
    Join Date
    Feb 2009
    Posts
    33
    Thanks
    6
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Gui and non-Gui thread problem

    Connecting objects in different threads is a little different than what you're expecting (slots are queued and executed via the event system when signalled, and parameters in the signals/slots get copied instead of passed directly). Check out the following links for more info...

    http://doc.trolltech.com/4.4/threads...-other-threads
    http://doc.trolltech.com/4.4/threads...across-threads

    and most importantly make sure you understand the design of the Mandlebrot example...
    http://doc.trolltech.com/4.4/threads-mandelbrot.html

    Hope that helps
    ~ andy.f

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.