Hi,

i'm using a QGLWidget in my class to establish a OpenGL Context. When i resize the QGLWidget using the resize method, the framebuffer will be resized as expected, but not the actual color target. For example, if i resize the widget to 1280x1024 and clear the scene using a red color, only a part of the scene will be cleared in red (as shown on the the following image)


The class using the QGLWidget:
Qt Code:
  1. class OpenGLExample
  2. {
  3. public:
  4. OpenGLExample()
  5. {
  6. widget.resize(1280,1024);
  7. widget.makeCurrent();
  8. }
  9.  
  10. void draw()
  11. {
  12. glClearColor(1.0f,0.0f,0.0f,0.0f);
  13. glClear(GL_COLOR_BUFFER_BIT);
  14. widget.grabFrameBuffer().save("test.png");
  15. }
  16. private:
  17. QGLWidget widget;
  18. };
To copy to clipboard, switch view to plain text mode 
And the main class:
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication app(argc,argv);
  4. OpenGLExample example;
  5. example.draw();
  6. return 0;
  7. }
To copy to clipboard, switch view to plain text mode 

glClear should affect the complete framebuffer and not only a part. Whats wrong with my code?

Thanks!