Results 1 to 3 of 3

Thread: Painting over QOpenGLWidget in QGraphicsview clears viewport

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,330
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Painting over QOpenGLWidget in QGraphicsview clears viewport

    Draw items over the image at a fixed place (so that they are always visible and not affected by zoom or translation).
    Have a look at QGraphicsView::drawForeground(). I use a class derived from QGraphicsView where I actually have two scenes. One of them is the conventional scene that is drawn in the paint event, the other is a special scene that holds the overlay objects. This one is drawn in drawForeground() and can have a transformation matrix different from the other scene. (The widget is actually more complex than that - it also uses the drawBackground() method to draw a bitmap image which is then overlaid by the scene, which is then overlaid by the foreground scene).

  2. The following user says thank you to d_stranz for this useful post:

    KaBro (28th April 2016)

Similar Threads

  1. QOpenGLWidget + QGraphicsView and performance
    By tanshihaj in forum Qt Programming
    Replies: 0
    Last Post: 25th January 2016, 09:50
  2. QGraphicsView inside of QAbstractItemView viewport
    By Paladin12 in forum Qt Programming
    Replies: 5
    Last Post: 24th January 2016, 14:15
  3. Detect changes to the Viewport in QGraphicsView
    By Casper14 in forum Qt Programming
    Replies: 1
    Last Post: 24th July 2014, 11:21
  4. Replies: 3
    Last Post: 12th October 2012, 10:44
  5. Replies: 5
    Last Post: 9th January 2012, 21:22

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