Results 1 to 5 of 5

Thread: How to find position of QGraphicsView within QgraphicsScene

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to find position of QGraphicsView within QgraphicsScene

    Just a quick question. I'm sure there's a solution out there, but I'm apparently not readily finding the appropriate function for QGraphicsView. See, my scene is much larger than the qgraphicsview (What I see of the scene in the window, as far as my understanding goes) and the user has the choice to scroll around the scene. Is it possible to find out exactly where the view is located in the scene as the user scrolls around and how? I basically need to know the scene coordinates of the view in the top left corner and bottom right corner.

    Also, does anyone know how to disable the scroll bars but still have a QGraphicsScene larger than the QGraphicsView? Or... is it possible to load images that are positioned outside the scene? I basically want to preload images before they come into the view, but the user shouldn't be able to scroll into the "preloading images" area on the outside of the view.

    EDIT:

    I found that one could find the scene coordinates of a view using QGraphicsView's mapToScene(), but now I need to find where a QGraphicItem's position is in the view. How would one do that?

    Do I need to get the item's scene, and then I can get the view using one of the scene's methods, and then use the above method? What steps does that take? It doesn't seem like I can get an item's scene or view but I may just be a n00b.
    Last edited by swbluto; 28th October 2009 at 20:04.

Similar Threads

  1. Replies: 0
    Last Post: 29th September 2009, 02:28
  2. Qt and VC++ instalation problem
    By gui.br in forum Installation and Deployment
    Replies: 6
    Last Post: 21st July 2009, 07:13
  3. Replies: 1
    Last Post: 11th June 2009, 05:49
  4. Replies: 0
    Last Post: 5th March 2009, 06:54
  5. problems installing Qt opensource with msvc2008 support
    By odin1985 in forum Installation and Deployment
    Replies: 6
    Last Post: 24th May 2008, 09:06

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.