Is there any good tutorial for mapping coordinate system?



  • Hi guys ;

    Is there any useful tutorial about how to use mapping coordinate system. I mean MapToScene MapToItem and so on...
    I read some posts in other forums, but they are not complete enough..!
    For example , I have a custom QGraphicsItem ( a Rectangle ) in my scene and I would like to retrieve the distance between Top-Left position of that item , to Top-Left of the my custom QGraphicsView . Or I would like to retrieve the distance between Top-Left position of that QGraphicsView , to Top-Left of the my custom QGraphicsScene , and so on ...

    Thanks for helping...


  • Moderators

    The coordinate system of graphics view framework is explained in the documentation.

    The problem with answering your questions is that they are not specific enough:

    I would like to retrieve the distance between Top-Left position of that item , to Top-Left of the my custom QGraphicsView

    What is a top-left position? If the item is rotated is that the top-left corner of the unrotated rectangle or the top-left corner of the rotated bounding box? What units would you like that distance in? The scene units (the scene can be scaled be scaled), item units (it can be scaled individually or relative to parent) or the view units (pixels? dpi independent units? something else?)?

    Or I would like to retrieve the distance between Top-Left position of that QGraphicsView , to Top-Left of the my custom QGraphicsScene

    Again, which units do you want that in? Scene, item(relative or absolute) or the view?

    and so on...

    I don't think there's a list of all the possibilities. If your case is not in the docs tell us what you need and we'll try to help you figure it out.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.