Results 1 to 2 of 2

Thread: Display progress on another thread

  1. #1
    Join Date
    Oct 2007
    Location
    Romania
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Question Display progress on another thread

    I want to make a custom dialog for displaying the progress of an operation. The operation is made on another thread which is not the UI thread. I cannot create the widget on that thread because QT does not allow that. If I create the widget on the UI thread and I update it from the worker thread I get a crash. Do you know a good approach to this problem? I am pretty new to Qt.

    Thank you.

  2. #2
    Join Date
    Sep 2007
    Posts
    19
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Display progress on another thread

    please, provide some code on this and details on crash?

    note that you should use signal-slots connections with Qt::QueuedConnection through different threads, for example
    Qt Code:
    1. connect(workThreadObject, SIGNAL(somethingChanged()), progressDialog, SLOT(getSomethingChanged()), Qt::QueuedConnection);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. busy progress bar without thread ?
    By npc in forum Newbie
    Replies: 34
    Last Post: 23rd July 2009, 09:29
  2. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  3. Replies: 10
    Last Post: 20th March 2007, 22:19
  4. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  5. Replies: 2
    Last Post: 6th January 2006, 21:15

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.