Hi
I am drawing a line using mouse clicks. The line is drawn using paint function as:
painter->drawLine(start_p, end_p);
painter->drawLine(start_p, end_p);
To copy to clipboard, switch view to plain text mode
The bounding rect of line is defined as:
QRectF Line
::boundingRect() const {
// bounding rectangle for line
return QRectF(start_p, end_p
).
normalized();
}
QRectF Line::boundingRect() const
{
// bounding rectangle for line
return QRectF(start_p, end_p).normalized();
}
To copy to clipboard, switch view to plain text mode
Screenshot from 2014-10-09 10:01:45.png
This shows the line painted. I get the bounding rect for this as shown:
Screenshot from 2014-10-09 10:01:25.png
I want to have the bounding rect according to the shape of the item, something like:
boundingrect.png
Bookmarks