Results 1 to 3 of 3

Thread: QThread plus textEdit appending

  1. #1
    Join Date
    Feb 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QThread plus textEdit appending

    Hello, I'm having difficulties with appending text to an textEdit whilng in a QThread,

    basically, I just call Bla.start() and in Bla::run() { ui->gui.textEdit->append("Test");


    When I run the program, it crashes instant, do anyone have any idea why?


    Thanks in advance.

    Kokos.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,369
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QThread plus textEdit appending

    Quote Originally Posted by Kokos View Post
    When I run the program, it crashes instant, do anyone have any idea why?
    Sure. Widgets are not thread-safe, you can't access them from threads other than the main thread.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Kokos (2nd April 2010)

  4. #3
    Join Date
    Feb 2010
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QThread plus textEdit appending

    Quote Originally Posted by wysota View Post
    Sure. Widgets are not thread-safe, you can't access them from threads other than the main thread.
    Aight.. Thanks for quick answer

Similar Threads

  1. Appending text to a file
    By janus in forum General Programming
    Replies: 8
    Last Post: 25th March 2009, 11:23
  2. QFtp appending of files
    By DIMEDROLL in forum Qt Programming
    Replies: 8
    Last Post: 2nd March 2009, 15:15
  3. data is not appending to the file
    By sudheer in forum Qt Tools
    Replies: 2
    Last Post: 3rd April 2008, 12:39
  4. appending QByteArray with variable.
    By jjbabu in forum Qt Programming
    Replies: 3
    Last Post: 18th October 2007, 08:24
  5. append slots not... appending?
    By Slip Nine in forum Newbie
    Replies: 1
    Last Post: 26th May 2006, 08:40

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
  •  
Qt is a trademark of The Qt Company.