PDA

View Full Version : QGLWidget, toolbox and paintGL()



mickey
20th March 2006, 19:00
I have a problem that sick me from much time;
When my application starts, starts 3 updateWidget and 3 initializeGL() (with a qglwidget)without reason;
I understand the cause is the toolbox; If I delete it in Designer this behavius there isn't;
I think that is happening: application draw the entire widgetGL (using entire width of mainForm), after insert toolboox, and then must re-paint() because the width is grow down;
is it possible? Why do I resolve it?
Thanks

wysota
20th March 2006, 22:14
Why do I resolve it?
That's a really good question. Why do you want to solve it?

mickey
20th March 2006, 23:57
That's a really good question. Why do you want to solve it?
Sorry. The question was: How do I resolve it? I'd like resolve it because: 1. I think that there are 2 paint unuseful (with toolBox 3 paintGL(), without it, 1 paintGL()!); then because I think the cause is a QWidget/toolBox/stackWidget don't put good; (or maybe a bug?) Thanks

wysota
21st March 2006, 01:05
But why do you treat one, two or even three additional paint events as bugs? Are they expensive enough to spend a month trying to get rid of them? Obcuring the GL window will cause a paint event too -- do you want to freeze all other windows just to prevent an additional paint event? I could understand if you had an additional repaint every second, but you have ONE or TWO additional repaints during the whole life of the application. It is true that it could be caused by repositioning widgets on the form and it is possible that by manipulating the order of creating widgets you might be able to get rid of one repaint, but is it really that important? Especially given the fact, that the repaint takes place at a well known point in time -- if you want it to be less expensive, just delay creation of complex objects until the additional repaint is completed. You'll get flicker, but will gain some cpu cycles.