Results 1 to 3 of 3

Thread: Long operation -> Refresh user interface

  1. #1
    Join Date
    Oct 2010
    Posts
    95
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Long operation -> Refresh user interface

    Hi,

    I have a long operation in my application. During this the QT UI is never refreshed. It is normal because the "UI thread" is the same.

    The operation MUST be in the same thread but I would like to continue to refresh some widgets.

    I have try this : QCoreApplication:rocessEvents(QEventLoop::AllEvents);

    On some machines it works but not on every computers !

    Do you think that there is a way to launch another thread that will force the refresh ?

    Thx

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Long operation -> Refresh user interface

    Hi,

    You may use QTimer in order to refresh your widgets in the same thread..

    Or you can move your "long operation" into seperate thread and emit a signal to trigger UI thread.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Long operation -> Refresh user interface

    For a reading: http://doc.qt.nokia.com/qq/qq27-responsive-guis.html

    Why MUST it stay in the same thread?

Similar Threads

  1. Programming user interface advice
    By onurozcelik in forum Qt Programming
    Replies: 4
    Last Post: 19th May 2010, 06:36
  2. Using SVG as user interface for fast prototyping
    By benlau in forum Qt Programming
    Replies: 1
    Last Post: 8th January 2010, 12:01
  3. Regarding Database Display through user interface
    By Tavit in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2008, 10:32
  4. User Interface with QTableView
    By Brandybuck in forum Qt Programming
    Replies: 1
    Last Post: 22nd March 2006, 23:24

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.