Results 1 to 20 of 23

Thread: mainwindow does not refresh

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: mainwindow does not refresh

    Quote Originally Posted by Mike
    You could create also a timer. The timer should fire every second or so, and then check the worker thread. If the thread is done, the time could raise an event or some other means to tell your app that the thread has finished.
    You don't need timers --- thread can posts such event when it finishes.

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

    Default Re: mainwindow does not refresh

    Or even emit a signal.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: mainwindow does not refresh

    Quote Originally Posted by wysota
    Or even emit a signal.
    In Qt3?

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

    Default Re: mainwindow does not refresh

    Quote Originally Posted by jacek
    In Qt3?
    I was speaking in general terms. QThread in Qt3 doesn't provide a signal for that, but you still can emit one (by sending an event, processing it and emitting a signal from the thread using the custom event handler and a wrapper (like void MyThread::emitFinished(){ emit finished(); })
    Last edited by wysota; 23rd January 2006 at 19:29.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: mainwindow does not refresh

    Quote Originally Posted by wysota
    QThread in Qt3 doesn't provide a signal for that
    Because QThread doesn't inherit QObject in Qt3. You would have to use multiple inheritance.

  6. #6
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: mainwindow does not refresh

    Read the docs on QThread, the examples given are enough for your case. You just have to post an event to the main / gui thread to alert it that the operation has finished. The GUI programming with qt3 book also has some very usefull examples.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: mainwindow does not refresh

    Quote Originally Posted by jacek
    Because QThread doesn't inherit QObject in Qt3. You would have to use multiple inheritance.
    Hmm... true, I didn't notice that.

Similar Threads

  1. mainwindow modality
    By user in forum Qt Programming
    Replies: 0
    Last Post: 11th July 2008, 01:54
  2. Refresh the Mainwindow at run time
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 15th November 2007, 14:16
  3. Notifying Mainwindow of an event..
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 9th November 2007, 22:29
  4. Replies: 1
    Last Post: 11th September 2007, 14:34
  5. Replies: 3
    Last Post: 23rd July 2006, 19:02

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.