Results 1 to 3 of 3

Thread: QgraphicsScene on QGLWidget background

  1. #1
    Join Date
    Oct 2009
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QgraphicsScene on QGLWidget background

    Hi,

    I have a QgraphicsScene that renders some animation using QPropertyAnimation.
    I would now like to place a QGLWidget in the background which renders its own animation using opengl APIs.
    I want both these animations to appear simultaneously. How do I go about doing this?
    I found posts and examples that tell me how to overpaint over QGLWidget using QPainter and others that tell me how to make the QGraphicsView transparent.
    But I want to use my existing animation code that uses QgraphicsScene with QPropertyAnimation and be able to plugin my opengl animation in the background.
    If I simply set the viewport on the QGraphicsView to my QGLWidget both the animations appear with some flickering and when the animation on my QgraphicsScene stops, only the gl animation is visible.

    I would appreciate any help here to enable me to do it the right way. Preferably with some sample code.

    Thanks,

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: QgraphicsScene on QGLWidget background

    It's nice to be important but it's more important to be nice.

  3. The following user says thank you to axeljaeger for this useful post:

    ksrini (30th October 2009)

  4. #3
    Join Date
    Oct 2009
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QgraphicsScene on QGLWidget background

    Quote Originally Posted by axeljaeger View Post
    Thank you! That was useful. I was able to achieve what I was trying to do. I do have some issues though, which I would attribute to possible errors in my code.
    I'm kind of new to Qt and Opengl. One issue that I face is, the animation rendering on my graphics scene (not my opengl background) flickers a lot but it doesnt disappear. How can I get rid of the flicker? I know it maybe hard for you to guess what I could be doing wrong without seeing my code, but I just thought it maybe a common issue that you could remember from the top of your head.

Similar Threads

  1. Adding QGLWidget to QGraphicsScene problem
    By sanjayshelke in forum Qt Programming
    Replies: 10
    Last Post: 26th April 2016, 15:03
  2. Replies: 0
    Last Post: 29th September 2009, 02:28
  3. How to redraw QGraphicsScene background in running
    By wisconxing in forum Qt Programming
    Replies: 3
    Last Post: 17th November 2008, 13:10
  4. OpenGL texture on QGraphicsScene background
    By Ovnan in forum Qt Programming
    Replies: 5
    Last Post: 11th July 2008, 10:39
  5. Replies: 0
    Last Post: 7th April 2008, 14:27

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.