Hi, myWidgetGl has resizeGL() but when I resize width window, in my scene Perspective seems don't take action; it works if I resize the hieght of window. Why this?

Qt Code:
  1. void MyWidget::resizeGL(int width,int height) {
  2. printf("resizeGL...\n");
  3. glMatrixMode (GL_PROJECTION);
  4. glLoadIdentity ();
  5. //cout << width << height << endl;
  6. GLdouble ratio=((GLdouble)width/(GLdouble)height);
  7. gluPerspective(45,ratio,3,40);
  8. glViewport (0, 0, (GLdouble) width, (GLdouble) height);
  9. glMatrixMode (GL_MODELVIEW);
  10. glLoadIdentity ();
  11. }
To copy to clipboard, switch view to plain text mode