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

David Carmona david.carmona93 at gmail.com
Mon Oct 26 13:51:01 CET 2015


Ok, I'm going to try and tell you.

David
Le 26 oct. 2015 13:59, "Michael Sué" <sue at sf.mpg.de> 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 than scenePos().x() and scenePos().y()
> respectively.
>
> You will have to normalize the rectangle coordinates. There is a QRect
> method for this. It exchanges coordinates so that width and height is
> positive. You can set the rectangle then.
>
> - Michael.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151026/215ca555/attachment.html>


More information about the Interest mailing list