Hi friends,

i tried to embed a QOpenGL widget to my QGraphicsView using QGraphicsProxyWidget .. i tried
adding the widget like this ..

Qt Code:
  1. QGraphicsProxyWidget *proxy = scene->addWidget(glWidget);
To copy to clipboard, switch view to plain text mode 
but it returns warning as
QPainter::begin: A paint device can only be painted by one painter at a time.
and it not showing the widget ...
when i replace the opengl widget with normal widget (QTextEdit) it renders it properly ..

my openGL paintGL() code is..

Qt Code:
  1. glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
  2. glMatrixMode(GL_PROJECTION);
  3. glLoadIdentity ();
  4. glOrtho(this->max_x,this->max_y,this->min_x,this->min_y,-1.0f,1.0f);
  5. glPushMatrix();
  6. glBindTexture(GL_TEXTURE_2D, texture);
  7. glBegin (GL_TRIANGLE_STRIP);
  8. ....
  9. ....
  10. glEnd ();
  11. glPopMatrix();
To copy to clipboard, switch view to plain text mode 


please help me in solving this issue ... where it requires painter.save() function ..? or some other ..? in QGLWidget where i have to use Qt GL functions ..?

please help me ... thanks in advance ..