[Qt-interest] QGraphicsScene pos

Andre Somers andre at familiesomers.nl
Tue Oct 26 11:36:34 CEST 2010


Op Di, 26 oktober, 2010 11:28 am, schreef pmqt71:
> Ok, thanks a lot.
>
> I actually was expecting this behaviour without calling any fitInView
> method.
>
> Just another question:
>
> I have the QRectF  -50.0, -50.0, 50.0, 50.0
>
> the width is 50??
>
> qDebug() << "width=" << rect.width();  //returns 50

Of course it is! As the documentation states, that QRectF constructor
takes the width and the height as the third and fourth parameter. If you
want to use points instead, then use QRectF(QPointF(-50.0, -50.0),
QPointF(50.0, 50.0));

André





More information about the Qt-interest-old mailing list