Results 1 to 2 of 2

Thread: Problem combining QWorkspace & QGLWidget

  1. #1
    Join Date
    Dec 2006
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem combining QWorkspace & QGLWidget

    I'm getting infinately increasing memory usage and GDI handle usage whenever I dynamically create QGLWidgets and add them to a QWorkspace. Interestingly, the leak only happens when I'm using a QTimer to drive the animation *and* only after a 2nd widget is created. No leaks occur with only 1 gl widget created. Eventually the computer will freak out (after thousands of GDI handles are allocated).

    I've narrowed the problem down to a bare minimum:
    - create a QMainWindow
    - set a QWorkspace as the centralWidget()
    - add menu item to create a new instance of your QGLWidget
    - the menu action creates a new GLWidget and uses the workspace's addWindow() function.
    - a QTimer is used (either in the QMainWindow or the GLWidget itself...doesn't matter) to drive the animation.

    Running the program and using the menu item to create new GLWidgets appears to work fine. New windows appear, each with unque instance of my GLWidget. However, after a 2nd window has been created, memory and GDI handles start getting allocated at regular intervals (implying a timer'd function) and never deallocated. I've stepped through the code and all things point to a Qt problem.

    Interestingly, the problem *does not happen* if I use anything other than a QWorkspace. So doing setCentralWidget(new QWidget) and then setting the layout to a QHBoxLayout does not show the same bad behavior.

    Any ideas? I'm stumped. I have example code it needed. Thanks.

    -Rob

  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: Problem combining QWorkspace & QGLWidget

    What things point to a Qt problem?

Similar Threads

  1. Retrieving offsets of scroll in QWorkspace
    By hardgeus in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 02:25
  2. QGLWidget renderText problem
    By mbjerkne in forum Qt Programming
    Replies: 1
    Last Post: 7th April 2006, 21:35
  3. Replies: 16
    Last Post: 7th March 2006, 15:57

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.