perfect, I'll try, thanks!
perfect, I'll try, thanks!
The scene represents the base coordinate system for all its items. The scene coordinate system describes the position of each top-level item, and also forms the basis for all scene events delivered to the scene from the view
This is what QtAssistant says... what I understand there is that inside the same scene, there shouldn't be two items, in the same position, but in different position once they are displayed... I mean, the variable says they are in the same position but graphically they are in different places (and always inside the same scene).
Hmm? Why not? If they have different bounding rectangles then they will be in different scene positions. Especially that there are other transformations (like scaling and rotation) involved.
Yes, that's clear :P my problem is, for instance: these two arrows are in the same scene but their scene positions are the same.
If I understand right, The scene represents the base coordinate system for all its items. The scene coordinate system describes the position of each top-level item, and also forms the basis for all scene events delivered to the scene from the view I have a problem because what's happening in my code is not possible.
More or less I solved it with mapToScene and mapFromScene... but when I try something more complicated it becomes crazy:
For example, I have two connected arrows (the finish of the first is aiming to the beginning of the second), they are different items so I get their coordinates with mapToScene and, from another object, I paint them using their coordinates (two QPoints for each arrow, the starting point and the finishing point, four in total) and mapFromScene.
Ok, this works fine... but when I create a QGraphicsItemGroup and I add both arrows, when I move that group the beginning of the third point (the starting point of the second arrow) becomes crazy again (the other three work fine, that's what I don't understand).
If I don't move the group, the coords are right. That's why I think I have done something strange in my code and my scene is not working properly.
it's just an example that happens sometimes... the code is quite extended and the problem should be hidden somewhere (please note the item come into another items sometimes, they change their parents and are saved and loaded few times... so just "paste" the problematic code seems impossible to me). I'd like to know if this is normal or, as I suppose, it has no sense at all (so I'll start to dive and find the problem).
I can't say if something is normal or not if I don't know what you didIt seems you are overcomplicating things somewhat but that is just an impression, I can't be certain without seeing what you did.
I'm more than 200% sure I'm overcomplicating things :P I'm very good on that! ^^
Anyway, now it works... cheating a little bit (forcing coordinates in other functions) but it works; the point seems to be that I don't really understand how the scene system coordinates work, and this is something out of the scope of the forum; I'll find a tutorial somewhere.
thanks!!
Bookmarks