Results 1 to 5 of 5

Thread: Qt 4.7 + QGLWidget causes lock up when window resizes/moves

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.7 + QGLWidget causes lock up when window resizes/moves

    Yes I do realize that this will cause the GL widget to update continuously, which is what I want as I am creating an animation.
    But you are updating your widget even when no animation is going on...
    You should start the timer when you want to animate something, and stop it when the animation is finished.
    Also, a 0 timer is a bit extreme for animation, the human eye will perceive a smooth motion with 24 fps, which is about 40ms.
    With a 0 timer you are making your application use CPU cycles that it doesn't need.

    If you make a simple project which only has a QGLWidget and a 0 timer, and it still locks, you might want to register a bug, with the code for reproducing it.
    However, at least based on the code you posted, I can't explain why you experience a lockup.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  2. #2
    Join Date
    Apr 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.7 + QGLWidget causes lock up when window resizes/moves

    The animation, the sun in my case, should never stop until the program closes. With the previous versions, 4.2-4.6, I was getting 60fps but now I have to use the 20ms delay and I get 45fps. Yes I realize that this is still acceptable to perceive a smooth animation but it's kind of a bummer that I'm not able to render as fast as I use to. I can only imagine that if I had a more complex scene to render that I would lose even more fps. The sample code I posted does just have a QGLWidget and a 0 timer, so I'll go with that to register a bug. Thanks for helping.

Similar Threads

  1. How to render context of QGLWidget, outside of the window
    By KnufflPuffl in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2010, 21:41
  2. QWidget/QGlwidget ( + window opacity )
    By medved6 in forum Qt Programming
    Replies: 0
    Last Post: 5th October 2010, 06:14
  3. Replies: 1
    Last Post: 2nd July 2010, 19:47
  4. problem: Window moves on click when maximized
    By Toshikazu in forum Qt Programming
    Replies: 3
    Last Post: 30th January 2010, 22:22
  5. Transparent window with QGLWidget
    By ultr in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2008, 07:01

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
  •  
Qt is a trademark of The Qt Company.