Hello,

I have a QGLWidget in my application which displays it's content in a centered 
square GL viewport. In resizeGL() I setup the GL viewport with:

int side = qMin(width, height);
glViewport((width - side) / 2, (height - side) / 2, side, side);

The initial glViewport() call doesn't produce the expected result. To have the 
viewport setup correctly, resizeGL() must be called after the widget has been 
shown. (i.e. by slightly resizing the window with the mouse). Then the OpenGL 
content "hops" into the desired size.

I could reproduce the problem by changing one line of the hellogl example:

hellogl/main.cpp, replace line:
  window.resize(window.sizeHint());
with 
  window.resize(800, 200);

then start the application, the Qt Logo is distorted. Slightly resize the 
window, and hop, the Qt Logo is resized to the correct size.

Any idea why this is happening ?

Thanks for your help!
JP
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to