Hi,

> I would like to create a Graphical User Interface which allows the user to 
> draw as many rectangles as he wants on an image using the left button of his 
> mouse.

In the mousePressEvent you would create a QGraphicsRectItem, add it to the 
graphics scene and make it "the current one".

In mouseMoveEvent you would change the current rect's edge according to the 
mouse position.

The code in "paint" seems not really necessary as graphics items added to the 
graphics scene know how to draw themselves.

Your image you would draw in the virtual drawBackground method of your graphics 
view.

- Michael.


_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to