Results 1 to 4 of 4

Thread: thread GUI access crash

  1. #1
    Join Date
    Oct 2010
    Posts
    11
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default thread GUI access crash

    hi

    i'm trying to make multible threads access and modify a textedit in the GUI, i used a signal from the thread to transfer a QString to the main windows slot which prints it.

    however it works when i start one thread only, but it shows this message:

    QObject::connect: Cannot queue arguments of type 'QTextCursor'
    (Make sure 'QTextCursor' is registered using qRegisterMetaType().)
    and starting multible threads crashes the program. is it because im connecting multiple signals to the same slot?

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: thread GUI access crash

    The message is stating exactly what is wrong, please show your connect statement.

  3. #3
    Join Date
    Oct 2010
    Posts
    11
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: thread GUI access crash

    solved
    just removed the the connection type from my connect statement (it was Qt:: DirectConnection)
    Last edited by liqxpil; 14th December 2010 at 14:53.

  4. #4
    Join Date
    Feb 2010
    Posts
    52
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Re: thread GUI access crash

    Is it a good idea to update a GUI from another thread. When I'm doing this type of thing, I usually pass a message from the worker thread to the GUI thread. Avoids a lot of problems when various GUI objects aren't thread safe.

Similar Threads

  1. Crash gracefully? No crash!
    By lni in forum Qt Programming
    Replies: 0
    Last Post: 7th July 2010, 03:59
  2. Segfault trying to access gui (single thread)
    By alexandernst in forum Newbie
    Replies: 2
    Last Post: 12th April 2010, 18:34
  3. Qt x11 GUI crash if multi-thread
    By wesley in forum Qt Programming
    Replies: 2
    Last Post: 21st January 2010, 09:11
  4. Replies: 16
    Last Post: 7th October 2009, 08:17
  5. [PyQt4] Crash when writing to QTextEdit in a thread
    By robtheg in forum Qt Programming
    Replies: 0
    Last Post: 13th May 2009, 02:50

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.