Check the bounding rect before drawing the rectangle.

Done with: Thomas
This commit is contained in:
Roberto Raggi
2010-01-29 12:28:51 +01:00
parent bafe4468aa
commit c35f7bbfcb

View File

@@ -228,7 +228,10 @@ void FormEditorItem::paintBoundingRect(QPainter *painter) const
painter->setPen(pen); painter->setPen(pen);
// int offset = m_borderWidth / 2; // int offset = m_borderWidth / 2;
painter->drawRect(boundingRect().adjusted(0., 0., -1., -1.));
const QRectF br = boundingRect();
if (br.isValid())
painter->drawRect(br.adjusted(0., 0., -1., -1.));
} }
void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)