[Qt-interest] Does QCoreApplication::processEvents() update timers?
Girish Ramakrishnan
girish at forwardbias.in
Tue Apr 28 05:51:47 CEST 2009
Karol Krizka wrote:
> Hi all,
>
> I am using a third party 3D engine to draw a scene in a QGLWidget. The
> scene is quite big, so it takes a while to load, so I want to show some kind
> of an animation while it loads. However, the engine is not thread safe, so I
> cannot do the loading in one thread and drawing in another. What I would like
> to do instead is to redrew the scene after each major component has been
> loaded. It will be a bit choppy, but better than nothing.
>
> I'm trying to accomplish this by having my drawing done inside a timer loop
> and call QApplication::processEvents(). Basically, I started a timer with
> QObject::startTimer() inside the QGLWidget and inside it I call updateGL().
> I'm hoping that when I call processEvents(), it will call timerEvent() every
> while in order to trigger the redraw. However that does not happen. The
> timerEvent() is not called at all during the loading stage.
>
> So my question is, does QApplication::processEvents() also update any
> running timers?
>
Yes, your object will get timerEvent() if you do processEvents(). Maybe
you can show some code with which you are facing this problem?
I also don't understand why you need to call processEvents() yourself.
Why not just start the timer and run the event loop i.e qApp->exec()?
Girish
More information about the Qt-interest-old
mailing list