PDA

View Full Version : setViewport(new QGLWidget()) consumming a lot of time



stella1016
20th April 2012, 17:09
I've got some old source code, which has certain switch that the rendering is done by OpenGL or not. The only difference is one line of code in the constructor of my QGraphicsView:



if(opengl_enabled)
this->setViewport(new QGLWidget());


I noticed that if opengl_enabled is true, the time consummed is quiet a lot. Without it, it is much faster. I didn't notice other changes in WINDOWS.
So I do not want to use this line of code. But then the openGL switch will not be considered. I need to know how to find a substitution.

Anyone knows the effect of this line of code? From doc, I know that, it let a widget for rendering OpenGL graphics to take ownership of the QAbstractScrollArea. But what else? How could I make it right? Thanks!