KProgressDialog / QTimer not working during widget construction
Guillaume Laurent
glaurent at telegraph-road.org
Mon Nov 4 20:40:07 GMT 2002
I'm having a problem trying to display a KProgressDialog during a long job
which is done during the construction of a widget. It seems that during that
time, even if I try to call KApplication::processEvents(), QTimer events are
held off. I've tried setting a QTimer::singleShot() with a rather small delay
(.5 secs), and it doesn't go off until after the widget creation is done,
which takes much more than .5 seconds.
Does anyone has a clue about this problem ?
Here's a link to a modified version of Qt's 'progress' example, which
demonstrates the problem.
http://telegraph-road.net/tmp/progress_bug.tar.bz2
I've modified it so it uses a KProgressDialog and starts drawing 100k
rectangles in the widget ctor, while calling processEvents() for each
rectangle drawn. The KProgressDialog never pops up, and the 2 seconds
singleshot QTimer which is armed right before the widget's creation fires
only once the widget is done with the drawing.
Somehow this doesn't look like a bug but more like a deliberate design, but
I'd like to know why, and mostly if there's a way around it.
--
Guillaume.
http://www.telegraph-road.org
More information about the kde-core-devel
mailing list