hello guys:
I want to define my own CanvasItem to draw on the QCanvas. Maybe a coordinate(maybe a class named Coordinate) with a X direction axis(which can be a QCanvasLine, I think) and a Y direction axis. And also some texts around the two axes.
That means the custom class Coordinate contains some properties like QCanvasLine, QCanvasText, QCanvasEllipse and some member functions in order to change these properties. And then I can draw the whole Coordinate by only one step on the canvas instead of adding each lines or texts everytime.
As the Qt document says, if you want a custom canvasitem, you can subclass the QCanvasPolygonalItem. I have tried this method, but it doesn't work. I think the QCanvasPolygonalItem maybe can not contain other QCanvasItem like QCanvasLine as its properties because it is also subclassed from QCanvasItem. Is that right?
But now I cannot figure out how to achieve my goal. Help me please. Thanks a lot.
Best regards.
Bookmarks