Results 1 to 14 of 14

Thread: [QGLWidget/QGLView][QSplitter] slow performance?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [QGLWidget/QGLView][QSplitter] slow performance?

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: [QGLWidget/QGLView][QSplitter] slow performance?

    Please define "speed up".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Slow SQLite performance
    By themagician in forum Newbie
    Replies: 0
    Last Post: 26th April 2012, 14:23
  2. QT App performance is too slow on OSX
    By joshhhab in forum Newbie
    Replies: 1
    Last Post: 28th May 2011, 08:30
  3. Slow performance of QGraphicsView - why?
    By zeldaknight in forum Newbie
    Replies: 2
    Last Post: 25th August 2010, 03:34
  4. Replies: 1
    Last Post: 8th August 2010, 20:04
  5. QGLWidget 2d painting performance
    By amnesiac in forum Qt Programming
    Replies: 15
    Last Post: 28th January 2008, 14:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.