Results 1 to 2 of 2

Thread: Multiple QGLWidgets slow performance

  1. #1
    Join Date
    Feb 2013
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Multiple QGLWidgets slow performance

    Hi All,
    My application has a bunch of frames with each frame having 3 to 4 QGLWidgets.
    Based on some user action I show a specific frame. No more
    than 4 QGLWidgets are visible any any point of time, though the number of
    QGLWIdgets is around 100.

    The problem is the renderers are very unresponsive. I created a test application to debug this.
    Refer to the attached screenshot TestQtQLWidget.jpg
    The code creates 36 frames with a QGLWIdget inside each frame. Each button
    is linked to a frame. Click on a button would maximize a specific frame.
    Clicking on "show all frames" will show all frames. Each frame a slightly different
    color .

    When I maximize the window and start clicking on buttons, after clicking about
    20 to 30 times the application becomes very slow and unresponsive.
    Also when you click on "show all frames" the response is slow. White
    background artifacts can also be seen sometimes.

    I have attached the code, it can also be downloaded from git://github.com/seesomi/DebugBugs.git

    I have the following questions:
    a) Is it ok to have so many QGLWidgets in a QT application ?
    b) How can I make the show/hide frame rendering smoother and not jerky as it is now
    c) Is this related to having so many GL contexts or gl context switching, if so would sharing GL contexts across multiple widgets help...
    d) Any other suggestions for improvement

    Thanks,
    Somesh
    Attached Images Attached Images
    Attached Files Attached Files

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

    Default Re: Multiple QGLWidgets slow performance

    Quote Originally Posted by seesomi View Post
    When I maximize the window and start clicking on buttons, after clicking about
    20 to 30 times the application becomes very slow and unresponsive.
    Also when you click on "show all frames" the response is slow. White
    background artifacts can also be seen sometimes.
    I cannot reproduce that on my system.

    a) Is it ok to have so many QGLWidgets in a QT application ?
    Well... you'd have to ask Apple as QT is their technology but if you ask about Qt then yes A different question is whether it makes sense or not.

    b) How can I make the show/hide frame rendering smoother and not jerky as it is now
    I would probably resign from using layouts in this case. Then I would first show the one frame you want to maximize and then when it is already shown I would gradually start hiding others returning to the event loop now and then to keep the ui responsive.

    c) Is this related to having so many GL contexts or gl context switching, if so would sharing GL contexts across multiple widgets help...
    I'm unable to answer this question. If you notice the app slowing down over time then I'd suspect some memory leak but I don't see where this leak would occur (in the GL driver maybe?)
    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. QPainter::end() slow when multiple QGLWidgets visible
    By cbamber85 in forum Qt Programming
    Replies: 0
    Last Post: 4th November 2012, 12:38
  2. Saving a QImage from multiple QGLWidgets
    By Rayven in forum Qt Programming
    Replies: 4
    Last Post: 23rd March 2011, 05:37
  3. Single QGLContext across multiple QGLWidgets
    By pseudosig in forum Qt Programming
    Replies: 2
    Last Post: 23rd June 2008, 00:13
  4. Textures + Multiple QGLWidgets
    By KShots in forum Qt Programming
    Replies: 8
    Last Post: 19th October 2007, 22:23
  5. Problem with multiple QGLWidgets
    By claustre in forum Qt Programming
    Replies: 2
    Last Post: 23rd February 2007, 14:37

Tags for this Thread

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.