I want to implement a axis of a coordinate. What I want to do is that:
How to do that? I think that, I can use two QgraphicsItems ( head , body ) to represent a axis. When the head is dragging, do the scaling. When the body is dragging, it does rotation.
Is there any better solution to do that?
You could do it as one graphics item, with the drag behaviour changing depending on where you click, but your suggestion is reasonable.
For your method, the arrow head will need to be a child item of the arrow body - so when you rotate the body it moves appropriately, and you will need a custom hack in the mouse click / mouse move events for the arrow head to resize the body appropriately.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.