Hello,
I have following code which gives me wrong output
{
setRect(0,0,100,100);
qDebug() << "Bounding rect is " << boundingRect();
}
MyRect::MyRect(QGraphicsItem *parent):QGraphicsRectItem(parent)
{
setRect(0,0,100,100);
qDebug() << "Bounding rect is " << boundingRect();
}
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
Bookmarks