Results 1 to 6 of 6

Thread: QGraphicsView to follow Item?

  1. #1
    Join Date
    May 2009
    Location
    Germany
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsView to follow Item?

    Hi,

    how can i make a QGraphicsView follow e.g. a QGraphicsRectItem which is movable, when i drag it outside the visible area of the view?
    Right now the scrollbars appear, but the item is not focused/visible.

    thanks in advance
    sven

  2. #2
    Join Date
    Aug 2008
    Posts
    60
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsView to follow Item?

    Hi Steve,
    I am facing the same problem, did you got any clue???

    Thank you.

  3. #3
    Join Date
    May 2009
    Location
    Germany
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsView to follow Item?

    not yet steve...

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView to follow Item?


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

    Default Re: QGraphicsView to follow Item?

    No, that doesnt affect the ScrollBars...

    I thought of sth like connecting the scrollbars to sceneRectangle which is actually impossible..

  6. #6
    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: QGraphicsView to follow Item?

    You should be able to install an event filter on the dragged object or better yet subclass the item and reimplement its itemChange() method. In there you can get the new item position and adjust the view accordingly.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QGraphicsView: restrict bbox of Item to bbox of scene?
    By piquadrat in forum Qt Programming
    Replies: 0
    Last Post: 2nd April 2009, 14:38
  2. MDI display Item in QGraphicsView
    By wisconxing in forum Qt Programming
    Replies: 1
    Last Post: 7th November 2008, 01:11
  3. View, Scene, Item and thread??
    By dungsivn in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2008, 20:21
  4. Item Delegate Painting
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2008, 08:37
  5. QGraphicsView and item focus
    By Micawber in forum Qt Programming
    Replies: 3
    Last Post: 22nd June 2007, 21:36

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.