Hi all,

What should I do to speed up the resizing performance?
Qt Code:
  1. #include <QApplication>
  2. #include <QGLWidget>
  3. #include <QMainWindow>
  4. #include <QSplitter>
  5. #include <QTextEdit>
  6.  
  7. class GLWidget : public QGLWidget
  8. {
  9. public:
  10. GLWidget(QWidget *parent = 0) : QGLWidget(parent) {}
  11. GLWidget(const QGLFormat &format, QWidget *parent = 0, const QGLWidget *shareWidget = 0, Qt::WindowFlags f = 0) :
  12. QGLWidget(format, parent, shareWidget, f){}
  13.  
  14. protected:
  15. virtual void paintGL();
  16. virtual void resizeGL(int, int) { }
  17. };
  18.  
  19. void GLWidget :: paintGL()
  20. {
  21.  
  22. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  23. glLoadIdentity();
  24.  
  25. glTranslatef(0.5f,0.5f,0.0f);
  26.  
  27. glBegin(GL_QUADS);
  28. glVertex3f(-1.0f, 1.0f, 0.0f);
  29. glVertex3f( 1.0f, 1.0f, 0.0f);
  30. glVertex3f( 1.0f,-1.0f, 0.0f);
  31. glVertex3f(-1.0f,-1.0f, 0.0f);
  32. glEnd();
  33. }
  34.  
  35. int main(int argc, char **argv)
  36. {
  37. QApplication app(argc, argv);
  38.  
  39. QMainWindow mainwindow;
  40.  
  41. mainwindow.setFixedSize(1000,600);
  42.  
  43. QSplitter *splitter = new QSplitter(Qt::Horizontal);
  44. splitter->addWidget(new QTextEdit());
  45. splitter->addWidget(new GLWidget());
  46.  
  47. mainwindow.setCentralWidget(splitter);
  48.  
  49. mainwindow.show();
  50.  
  51. return app.exec();
  52. }
To copy to clipboard, switch view to plain text mode 

Thanks in advance.

Cheers,
Faizol