From c35f7bbfcb8fece75eaac266da03bf36a97215fb Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Fri, 29 Jan 2010 12:28:51 +0100
Subject: [PATCH] Check the bounding rect before drawing the rectangle.

Done with: Thomas
---
 .../qmldesigner/components/formeditor/formeditoritem.cpp     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
index 730e50a6714..85bb438da5e 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
@@ -228,7 +228,10 @@ void FormEditorItem::paintBoundingRect(QPainter *painter) const
 
     painter->setPen(pen);
 //    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 *)
-- 
GitLab