[qet] [3534] Fix artefact on qgraphics scene when remove a linked element

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3534
Author:   blacksun
Date:     2014-12-07 16:47:58 +0100 (Sun, 07 Dec 2014)
Log Message:
-----------
Fix artefact on qgraphics scene when remove a linked element

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/commentitem.cpp
    trunk/sources/qetgraphicsitem/crossrefitem.cpp

Modified: trunk/sources/qetgraphicsitem/commentitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/commentitem.cpp	2014-12-06 17:56:07 UTC (rev 3533)
+++ trunk/sources/qetgraphicsitem/commentitem.cpp	2014-12-07 15:47:58 UTC (rev 3534)
@@ -129,6 +129,7 @@
 		text_bounding.adjust(-1,0,1,0); //adjust only for better visual
 		painter.drawRoundedRect(text_bounding, 2, 2);
 
+		prepareGeometryChange();
 		m_bounding_rect = text_bounding;
 	}
 

Modified: trunk/sources/qetgraphicsitem/crossrefitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/crossrefitem.cpp	2014-12-06 17:56:07 UTC (rev 3533)
+++ trunk/sources/qetgraphicsitem/crossrefitem.cpp	2014-12-07 15:47:58 UTC (rev 3534)
@@ -157,11 +157,12 @@
  * Update the content of the item
  */
 void CrossRefItem::updateLabel() {
-	//init the shape and bounding rect
+		//init the shape and bounding rect
 	m_shape_path    = QPainterPath();
+	prepareGeometryChange();
 	m_bounding_rect = QRectF();
 
-	//init the painter
+		//init the painter
 	QPainter qp;
 	qp.begin(&m_drawing);
 	QPen pen_;
@@ -169,7 +170,7 @@
 	qp.setPen(pen_);
 	qp.setFont(QETApp::diagramTextsFont(5));
 
-	//Draw cross or contact, only if master element is linked.
+		//Draw cross or contact, only if master element is linked.
 	if (! m_element->linkedElements().isEmpty()) {
 		XRefProperties::DisplayHas dh = m_properties.displayHas();
 
@@ -183,7 +184,6 @@
 	qp.end();
 
 	autoPos();
-	update();
 	checkMustShow();
 }
 
@@ -303,6 +303,7 @@
 	}
 
 	m_shape_path.addRect(default_bounding);
+	prepareGeometryChange();
 	m_bounding_rect = default_bounding;
 }
 
@@ -361,6 +362,7 @@
 	}
 
 	QRectF br(0, 0, 50, m_drawed_contacts*10+4);
+	prepareGeometryChange();
 	m_bounding_rect = br;
 	m_shape_path.addRect(br);
 }
@@ -518,6 +520,7 @@
 		text_bounding.adjust(-1,0,1,0); //adjust only for better visual
 
 		m_shape_path.addRect(text_bounding);
+		prepareGeometryChange();
 		m_bounding_rect = m_bounding_rect.united(text_bounding);
 		painter.drawRoundedRect(text_bounding, 2, 2);
 		painter.restore();


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/