Results 1 to 2 of 2

Thread: Detect changes to the Viewport in QGraphicsView

  1. #1
    Join Date
    Jun 2014
    Posts
    7
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Detect changes to the Viewport in QGraphicsView

    I have subclassed QGraphicsView, and now I need to respond to events that might change what is currently displayed in the viewport. I am not interested in changes to the scene, I only need to react to events like scrolling, and dragging, i.e., events that would change which part of the scene is currently visible in the QGraphicsView. The reason I need to do this is that these same changes should be applied to another QGraphicsView.

    I have not been able to find any help on the internet, so I am not sure if something like this even exists. The only link I could find is dead: http://www.qtforum.org/article/28739...ged-event.html ("QGraphicsView viewport changed event?")

    What are my options? Is there any alternative to just manually listening for all different types of events that might change the viewport? Ideally there would be some signal that I could connect to...

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Detect changes to the Viewport in QGraphicsView

    If it is just about movement, you could connect to the vallueChanged signals of the two scrollbars. Maybe even connect to the other view's scrollbars.

    Cheers,
    _

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

    Casper14 (24th July 2014)

Similar Threads

  1. QGraphicsView inside of QAbstractItemView viewport
    By Paladin12 in forum Qt Programming
    Replies: 5
    Last Post: 24th January 2016, 15:15
  2. Replies: 1
    Last Post: 1st October 2013, 06:18
  3. how to detect if QGraphicsTextItem is inside viewport
    By mihnen in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2012, 04:57
  4. Replies: 5
    Last Post: 9th January 2012, 22:22
  5. Replies: 0
    Last Post: 17th August 2008, 18:31

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.