PDA

View Full Version : Long operation -> Refresh user interface



pl01
31st January 2011, 09:48
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::processEvents(QEventLoop::AllEve nts);

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

zgulser
31st January 2011, 10:05
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.

Lykurg
31st January 2011, 10:23
For a reading: http://doc.qt.nokia.com/qq/qq27-responsive-guis.html

Why MUST it stay in the same thread?