Re: [Interest] Draw multiple rectangles in a QGraphicsItem using the mouse

2015-12-26 Thread david.carmona93
Hi everybody, I am currently trying to resize a QGraphicsRectItem through my QGraphicsScene using the MouseMoveEvent method. In the latter, I’m checking if the application is in the “startModifying” mode (Therefore, if he wants to modify a rectangle) and in which corner the moue is: IsOnTopL

Re: [Interest] Draw multiple rectangles in a QGraphicsItem using the mouse

2015-10-26 Thread David Carmona
Ok, I'm going to try and tell you. David Le 26 oct. 2015 13:59, "Michael Sué" a écrit : > Hi David, > > > However, I have some problems when I actually want to draw rectangles > with negatives width and height. I mean when the values of origPoint.x() and > > origPoint.y() are strictly higher tha

Re: [Interest] Draw multiple rectangles in a QGraphicsItem using the mouse

2015-10-26 Thread Michael Sué
Hi David, > However, I have some problems when I actually want to draw rectangles with > negatives width and height. I mean when the values of origPoint.x() and > origPoint.y() are strictly higher than scenePos().x() and scenePos().y() > respectively. You will have to normalize the rectangle c

Re: [Interest] Draw multiple rectangles in a QGraphicsItem using the mouse

2015-10-26 Thread David Carmona
Hi Michael, I implemented your method and it works pretty well. Thank you so much for your help. This is the code (ImageGraphicsSceneW subclasses ImageGraphicsScene). void ImageGraphicsSceneW::mousePressEvent(QGraphicsSceneMouseEvent *event) { origPoint=event->scenePos(); qDebug()<<"orig

Re: [Interest] Draw multiple rectangles in a QGraphicsItem using the mouse

2015-10-20 Thread David Carmona
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é" 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

Re: [Interest] Draw multiple rectangles in a QGraphicsItem using the mouse

2015-10-19 Thread Michael Sué
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

[Interest] Draw multiple rectangles in a QGraphicsItem using the mouse

2015-10-19 Thread David Carmona
Hi everybody, 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. I have already implemented part of the code. I have a QGraphicsView which displays an image contained in a scene : bool Imag