Results 1 to 2 of 2

Thread: Help with scene

  1. #1
    Join Date
    Jun 2010
    Posts
    22
    Qt products
    Qt4
    Platforms
    Windows

    Default Help with scene

    How do I make the top-left corner (0,0) instead of the center being (0,0).

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 268 Times in 268 Posts
    Wiki edits
    20

    Default Re: Help with scene

    Did you try setting a scene rect?
    Example: (0,0,640,320)

    I can't check right now if this solves it but I guess it will.
    If not, you need to translate the items.

    If you don't set a scene rect, the scene rect will be the largest bounding box of all the items in it.
    This means, that if there are no items in the scene yet, and you choose to center the scene in the view, all new items are created at the center (if you don't use the position to set a specific position. I guess the scene grows around the center in both positive and negative direction. Therefor, if you set a scene rect at the beginning, it might solve some things.

    Als, as mentioned already, try not the set the scene at the center of the view but in the top left corner.

Similar Threads

  1. Clear a Scene
    By peace_comp in forum Qt Programming
    Replies: 7
    Last Post: 20th May 2008, 19:44
  2. Creating a scene from piece of another scene
    By maverick_pol in forum Qt Programming
    Replies: 3
    Last Post: 23rd August 2007, 18:51
  3. Zooming scene
    By maverick_pol in forum Qt Programming
    Replies: 12
    Last Post: 2nd August 2007, 18:37
  4. can I get another QGraphicsView's scene?
    By sincnarf in forum Qt Programming
    Replies: 1
    Last Post: 28th June 2007, 22:41
  5. Possible QGraphicsView/Scene bug
    By Corran in forum Qt Programming
    Replies: 1
    Last Post: 30th December 2006, 02:47

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.