QGLWidget updateGL () not updating with QTimer?

I have a QTimer object and you want to update QGLWidget several times over a certain period of time.

My problem is that the content does not update when I call the updateGL () method on "QGLWidget".

This is how I run QTimer,

rotationTimer=new QTimer(); rotationTimer->setInterval(500); QObject::connect(rotationTimer, SIGNAL(timeout()), this, SLOT(slotAutoRotate()),Qt::QueuedConnection); 

in the slot AutoRotate (),

 void RzState3DCurveSelect::slotAutoRotate() { RzStateMachine3DCurves *sm3d =(RzStateMachine3DCurves*) this->getStateMachine(); setYRotation(yRot+5); sm3d->getQGLWidget()->updateGL(); // <---- call updateGL() of the widget. //QApplication::processEvents(); } 

I even see debugging information that I write in the lateral paintGL () method, but the contents are not updated unless I move the mouse over widgets or some other interaction.

0
source share
1 answer

You should use update () instead of updateGL ()

+2
source

All Articles