tags:

views:

103

answers:

2

Hey, I'm using QT with opengl to make a chart in order to use it in different simulated physical experiments, but I'm facing the following problem. I can't see my chart line unless I minimized my form window and then maximized it, and I should do that all the time as long as my line chart is being drawn in order to get the full result!! What can I do, this is urgent and I need this chart working properly without minimizing and maximizing.??

+3  A: 

It looks like you aren't doing a repaint until minimize/maximize. I suggest using a timer to get the job done. Posting your code will help!!

batbrat
you mean calling "updateGL()"?, sorry I can't post the code, it's like a huge project.
Shaza
Create a test-case and post that :)
batbrat
Are you using QGLWidget, inheriting from something, or using an embedded context? Basically, what type of widget is doing the rendering and display?
Adam W
Yep, I'm inheriting from QGLWidget.
Shaza
+1  A: 

That's right batbrat, the missing call is updateGL, I used the following timer and it all worked, thanks.

QTimer *timer = new QTimer( this );
connect( timer, SIGNAL(timeout()), this, SLOT(updateGL()));
timer->start(6);
Shaza
You should mark his answer as accepted
Daniel S
Thanks for making me notice that, I'm still new here :)
Shaza