Hi Michael, Thank you for your answer. I'm going to try it and tell you.
Regards David Le 20 oct. 2015 08:42, "Michael Sué" <s...@sf.mpg.de> a écrit : > 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 Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest