Results 1 to 3 of 3

Thread: Viewport and scene coordinates

  1. #1
    Join Date
    Oct 2008
    Posts
    28
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Viewport and scene coordinates

    I have this difficulty. i think I am really messed up with all the different coordinates.

    We have two classes, QGraphicsScene and QGraphicsView. The second displays the items of the first. Each of them has properties heigth and width. Also, they both have sceneRect.

    When I resize the QGraphicsView, height and width change, as they supposed to. But the sceneRect remains the same.

    In QGraphicsScene, sceneRect represents all the rectangular area of the scene. By default QGraphicsView's sceneRect covers the same area. They both are independent from the size of the window of the view.

    Now, how do I connect the size of the window, that is the size of the QGraphicsView with the local coordinates of it. I mean, when I write setOffset(x, y), how am I sure that x, y are the distances from the top left of the widow, that is (0,0) ?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Viewport and scene coordinates

    Please don't start multiple threads on the same problem.

  3. #3
    Join Date
    Oct 2008
    Posts
    28
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Viewport and scene coordinates

    It's not multiple threads. Viewport or scene coordinates have nothing to do with "Image processing", which was the name of the other thread.

Similar Threads

  1. Replies: 4
    Last Post: 5th August 2008, 19:55
  2. Working with coordinates (QGraphicsScene/view)
    By maverick_pol in forum Qt Programming
    Replies: 5
    Last Post: 27th March 2008, 08:35
  3. real world coordinates in graphics view / scene
    By robertson1 in forum Qt Programming
    Replies: 2
    Last Post: 7th December 2007, 23:21
  4. Creating a scene from piece of another scene
    By maverick_pol in forum Qt Programming
    Replies: 3
    Last Post: 23rd August 2007, 17:51

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.