Hi.
I'm making a drawing app and i want to be able to draw lines, rectangles, ellipses ,...
I've think making like this:
1- Save the starting point
void mousePressEvent(QMouseEvent *event);
To copy to clipboard, switch view to plain text mode
2- Draw temporal shape based on the type of cursor
void mouseMoveEvent(QMouseEvent *event);
To copy to clipboard, switch view to plain text mode
3- Finish the draw and add it to the scene
void mouseReleaseEvent(QMouseEvent *event);
To copy to clipboard, switch view to plain text mode
But i don't know how to make the second step, drawing the temporal shape (rectangle, circle, line, ...) while the user has the button pressed until it's released.
Some ideas?
Bookmarks