Does anyone know why QRectF right()/bottom() methods behaves differently than QRect ?
The following example
QRectF r1(0, 0, 20, 20);
qDebug() << r1.right();
QRect r2(0, 0, 20, 20);
qDebug() << r2.right();
returns this result:
20
19
When I tried to measure width(), both returns 20
QRectF r1(0, 0, 20, 20);
qDebug() << r1.width();
QRect r2(0, 0, 20, 20);
qDebug() << r2.width();
20
20
I tried to check documentation but I didn't find any mention of these differences.
What is the reason for this? And how to use QRectF in the case of QGraphicsItem when drawing 1-pixel width line without antialiasing? Should I always adjust boundingRect().adjust(0,0,-1,-1) ?