mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Fix artefact on qgraphics scene when remove a linked element
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3534 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -129,6 +129,7 @@ void CommentItem::updateLabel() {
|
|||||||
text_bounding.adjust(-1,0,1,0); //adjust only for better visual
|
text_bounding.adjust(-1,0,1,0); //adjust only for better visual
|
||||||
painter.drawRoundedRect(text_bounding, 2, 2);
|
painter.drawRoundedRect(text_bounding, 2, 2);
|
||||||
|
|
||||||
|
prepareGeometryChange();
|
||||||
m_bounding_rect = text_bounding;
|
m_bounding_rect = text_bounding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,11 +157,12 @@ void CrossRefItem::updateProperties() {
|
|||||||
* Update the content of the item
|
* Update the content of the item
|
||||||
*/
|
*/
|
||||||
void CrossRefItem::updateLabel() {
|
void CrossRefItem::updateLabel() {
|
||||||
//init the shape and bounding rect
|
//init the shape and bounding rect
|
||||||
m_shape_path = QPainterPath();
|
m_shape_path = QPainterPath();
|
||||||
|
prepareGeometryChange();
|
||||||
m_bounding_rect = QRectF();
|
m_bounding_rect = QRectF();
|
||||||
|
|
||||||
//init the painter
|
//init the painter
|
||||||
QPainter qp;
|
QPainter qp;
|
||||||
qp.begin(&m_drawing);
|
qp.begin(&m_drawing);
|
||||||
QPen pen_;
|
QPen pen_;
|
||||||
@@ -169,7 +170,7 @@ void CrossRefItem::updateLabel() {
|
|||||||
qp.setPen(pen_);
|
qp.setPen(pen_);
|
||||||
qp.setFont(QETApp::diagramTextsFont(5));
|
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()) {
|
if (! m_element->linkedElements().isEmpty()) {
|
||||||
XRefProperties::DisplayHas dh = m_properties.displayHas();
|
XRefProperties::DisplayHas dh = m_properties.displayHas();
|
||||||
|
|
||||||
@@ -183,7 +184,6 @@ void CrossRefItem::updateLabel() {
|
|||||||
qp.end();
|
qp.end();
|
||||||
|
|
||||||
autoPos();
|
autoPos();
|
||||||
update();
|
|
||||||
checkMustShow();
|
checkMustShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,6 +303,7 @@ void CrossRefItem::setUpCrossBoundingRect(QPainter &painter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_shape_path.addRect(default_bounding);
|
m_shape_path.addRect(default_bounding);
|
||||||
|
prepareGeometryChange();
|
||||||
m_bounding_rect = default_bounding;
|
m_bounding_rect = default_bounding;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,6 +362,7 @@ void CrossRefItem::drawHasContacts(QPainter &painter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QRectF br(0, 0, 50, m_drawed_contacts*10+4);
|
QRectF br(0, 0, 50, m_drawed_contacts*10+4);
|
||||||
|
prepareGeometryChange();
|
||||||
m_bounding_rect = br;
|
m_bounding_rect = br;
|
||||||
m_shape_path.addRect(br);
|
m_shape_path.addRect(br);
|
||||||
}
|
}
|
||||||
@@ -518,6 +520,7 @@ void CrossRefItem::AddExtraInfo(QPainter &painter) {
|
|||||||
text_bounding.adjust(-1,0,1,0); //adjust only for better visual
|
text_bounding.adjust(-1,0,1,0); //adjust only for better visual
|
||||||
|
|
||||||
m_shape_path.addRect(text_bounding);
|
m_shape_path.addRect(text_bounding);
|
||||||
|
prepareGeometryChange();
|
||||||
m_bounding_rect = m_bounding_rect.united(text_bounding);
|
m_bounding_rect = m_bounding_rect.united(text_bounding);
|
||||||
painter.drawRoundedRect(text_bounding, 2, 2);
|
painter.drawRoundedRect(text_bounding, 2, 2);
|
||||||
painter.restore();
|
painter.restore();
|
||||||
|
|||||||
Reference in New Issue
Block a user