Results 1 to 14 of 14

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

  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.


  3. #3
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

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

    Quote Originally Posted by wysota View Post
    Please define "speed up".
    An increase in speed performance relative to the current speed regardless of what is the base speed?


    Added after 4 minutes:


    is this a still open bug as reported here?
    https://bugreports.qt-project.org/browse/QTBUG-17869

    Thanks.
    Last edited by faizol; 22nd October 2012 at 17:43.

  4. #4
    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?

    Quote Originally Posted by faizol View Post
    An increase in speed performance relative to the current speed regardless of what is the base speed?
    Oh... such a smart definition. Ok, here you go -- to get a speed up, use an empty window instead of one with content!

    /me is astonished by his brilliant answer...
    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.


  5. #5
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

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

    Quote Originally Posted by wysota View Post
    Oh... such a smart definition. Ok, here you go -- to get a speed up, use an empty window instead of one with content!

    /me is astonished by his brilliant answer...
    LOL.

    On the other hand, you can just let other users who are willing to help to answer it. Surely I appreciate any help and I'll try to help other users as well.
    Last edited by faizol; 22nd October 2012 at 18:35.

  6. #6
    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?

    Quote Originally Posted by faizol View Post
    On the other hand, you can just let other users who are willing to help to answer it.
    I am trying to help but if you ask a general question, you can only get a general answer.

    BTW. I can see your original post content...
    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.


  7. #7
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

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

    Quote Originally Posted by wysota View Post
    I am trying to help but if you ask a general question, you can only get a general answer.
    I can't be more specific as the question -is- general (the same with the sample given). Otherwise the sample would have been more specific.

    Quote Originally Posted by wysota View Post
    BTW. I can see your original post content...
    you should, as that was for you (the golden rule in action). But out of respect to other users, I decided to edit it.

  8. #8
    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?

    Quote Originally Posted by faizol View Post
    I can't be more specific as the question -is- general (the same with the sample given). Otherwise the sample would have been more specific.
    Then the proper answer for such a general question is "do less" and that's what you were given. I'm not sure what other answer you expected to get.

    Actually I can be a bit more specific but I don't think it will do you any good... You can manipulate the "opaqueResizing" property of QSplitter. Other than that, with such a short snippet as what you provided there is nothing you can do with your code to get a spectacular speed improvement. You can fix Qt if you're suffering from some bug in QSplitter code...
    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.


  9. The following user says thank you to wysota for this useful post:

    faizol (22nd October 2012)

  10. #9
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

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

    Thanks. I've done some simple testing based on your answer and that got me to a point where I can do a bit more experimentations with my code. Really appreciate it.

    Cheers,
    Faizol

  11. #10
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

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

    Tested the attached code with Qt5 beta and the lagging response was when linking with Qt5. On the contrary the interactivity was ok when the code was linked against Qt4. Didn't quite expect the gap in performance.

    Cheers,
    Last edited by faizol; 23rd October 2012 at 20:19.

  12. #11
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

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

    status: reported, and accepted as a critical bug (Qt5).

  13. #12
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

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

    Status: regression resolved

    https://codereview.qt-project.org/#change,39437

    Change By: Samuel Rødal (14/Nov/12 3:21 PM)
    Status: Resolved
    Changes: 4334e0fcc60497da73671063deb68fb1661f864c
    Fix Version/s: 5.0.0 RC 1
    Resolution: Done

  14. #13
    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?

    Congratulations
    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.


  15. #14
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

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

    Quote Originally Posted by wysota View Post
    Congratulations
    That belongs to Samuel Rødal who did all the work and credits are all his.

    Glad though this is resolved and I can go back and start coding using Qt5 again.

    Many thanks.

    Cheers,
    Faizol
    Last edited by faizol; 15th November 2012 at 10:20.

Similar Threads

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