Hello,

I have following code which gives me wrong output


Qt Code:
  1. MyRect::MyRect(QGraphicsItem *parent):QGraphicsRectItem(parent)
  2. {
  3. setRect(0,0,100,100);
  4. qDebug() << "Bounding rect is " << boundingRect();
  5. }
To copy to clipboard, switch view to plain text mode 


And the output is as follows.

Bounding rect is QRectF(-0.5,-0.5 101x101)

Why x,y,width and height has changed than what I set. Because of this change, this item move topside when x,y,width and height is added with some factor at runtime.


Regards

Manish