[Qt-interest] running a loop and emitting events.

Arnold Krille arnold at arnoldarts.de
Fri Apr 3 20:06:53 CEST 2009


On Friday 03 April 2009 16:15:06 Ender EREL wrote:
> Using a different thread should do the trick, or you can use
> QCoreApplication::processEvents() to keep the events running.

Or do it the other way round:
Instead of running a loop that calls QCoreApplication::processEvents() and 
basicly eats up 100% cpu-time, create a slot for your real work and re-
schedule it periodically with QTimer::singleShot(). Or with a periodic QTimer 
so you don't create a new timer object every run. And maybe you can set the 
interval to 100ms or 10ms instead of 0ms... That would keep your gui smooth 
and responsive.

Have fun,

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090403/d732cf37/attachment.bin 


More information about the Qt-interest-old mailing list