Results 1 to 11 of 11

Thread: QGraphicsView, QGraphicsItem, QGraphicsScene

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsView, QGraphicsItem, QGraphicsScene

    I always tell to my students that the scene is the world, the view is the window they're looking through at the world and the items are things that are part of the world that one sees through the window. The world is self-sufficient (you don't need to have any windows for the world to be there and be useful) and objects in the world form hierarchies where children are positioned in a "local world" of their parent -- like people on Earth, Earth in the Solar System, Solar System in the Milky Way, Milky Way in the local cluster of galaxies, etc. And people don't care that Milky Way rotates around the centre of the local cluster, they use local coordinates relative to the Earth exactly the same way as items in the scene don't care about surroundings of its parent and use local coordinates relative to their parent.
    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.


  2. The following 2 users say thank you to wysota for this useful post:

    alitoh (23rd March 2011), cgyan1 (11th March 2012)

  3. #2
    Join Date
    Mar 2011
    Posts
    82
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView, QGraphicsItem, QGraphicsScene

    Thank you for your answers!

    To extend on this issue a little bit more.

    Are the QGraphicsScene coordinates relative to the Dlg window? That is; the single pixel left-top corner below the dialog bar, 0,0, is also the Scene's 0,0?

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

    Default Re: QGraphicsView, QGraphicsItem, QGraphicsScene

    Again, QGraphicsScene is the world. The widget (view) is a window in a house. Coordinates of the world are not relative to the window in the house because the house may not even exist. Of course it is possible to map coordinates of each place in the world relative to the glass in the window in the house provided the window in the house exists. This is called a projection and its properties change if you come closer or move away from the window surface. This doesn't change the world (scene) in any way although if you change your position, you see a different part of the world. So to answer your question the top-left corner of the window is not the top-left corner of the world.
    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.


  5. The following 2 users say thank you to wysota for this useful post:

    alitoh (24th March 2011), cgyan1 (11th March 2012)

Similar Threads

  1. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31
  2. Using QGraphicsView with model/view programming
    By JLP in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2007, 11:04
  3. QGraphicsScene and QThread
    By tts80 in forum Qt Programming
    Replies: 5
    Last Post: 10th January 2007, 09:32
  4. QGraphicsView and QGraphicsScene speeds
    By jnk5y in forum Qt Programming
    Replies: 2
    Last Post: 20th October 2006, 07:13
  5. (QT4.2-RC1) QGraphicsScene QGraphicsView QGraphicsItem
    By antonio.r.tome in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 10:56

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.