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
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
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
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
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
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
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