^NyAw^
30th October 2008, 12:41
Hi,
How can I use the mouse to draw shapes? I want to draw Rectangular, Circular, Elliptic and Irregular shapes. For Rectangular, Circular and Elliptic shapes I'd like to make them resizable by using square corners. The Irregular shape have to be painted by clicking the mouse and moving the pointer, when releasing the mouse it will have to close the shape.
I'm tinking on using QGraphicsView with every shape as QGraphicsItem but I don't know how to implement the resizing code.
Another question: I have a QScrollArea with a internal QWidget. Can the QScrollArea or the QWidget be used as viewport of the QGraphicsView?
Thanks,
How can I use the mouse to draw shapes? I want to draw Rectangular, Circular, Elliptic and Irregular shapes. For Rectangular, Circular and Elliptic shapes I'd like to make them resizable by using square corners. The Irregular shape have to be painted by clicking the mouse and moving the pointer, when releasing the mouse it will have to close the shape.
I'm tinking on using QGraphicsView with every shape as QGraphicsItem but I don't know how to implement the resizing code.
Another question: I have a QScrollArea with a internal QWidget. Can the QScrollArea or the QWidget be used as viewport of the QGraphicsView?
Thanks,