mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Probably fix the fucking crash of ghost conductor.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4752 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -501,6 +501,7 @@ void Conductor::paint(QPainter *qp, const QStyleOptionGraphicsItem *options, QWi
|
|||||||
qp -> drawEllipse(QRectF(point.x() - 1.5, point.y() - 1.5, 3.0, 3.0));
|
qp -> drawEllipse(QRectF(point.x() - 1.5, point.y() - 1.5, 3.0, 3.0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qp -> restore();
|
qp -> restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -723,9 +724,21 @@ QPainterPath Conductor::shape() const
|
|||||||
|
|
||||||
QPainterPath shape_(pps.createStroke(path()));
|
QPainterPath shape_(pps.createStroke(path()));
|
||||||
|
|
||||||
if (isSelected())
|
/**
|
||||||
foreach (QRectF rect, m_handler.handlerRect(handlerPoints()))
|
Add handle rect to path, occur a weird bug.
|
||||||
shape_.addRect(rect);
|
when the conductor is removed from the scene he continue to be painted in the scene and make artefact.
|
||||||
|
If we save (exactly when we clear the undo stack of project when saving), Qet crash,
|
||||||
|
Don't add the handle rect to the path seem to work well.
|
||||||
|
More information here :
|
||||||
|
https://qelectrotech.org/bugtracker/view.php?id=107
|
||||||
|
https://qelectrotech.org/forum/viewtopic.php?pid=5619#p5619
|
||||||
|
https://qelectrotech.org/forum/viewtopic.php?pid=5067#p5067
|
||||||
|
**/
|
||||||
|
// if (isSelected()) {
|
||||||
|
// foreach (QRectF rect, m_handler.handlerRect(handlerPoints())) {
|
||||||
|
// shape_.addRect(rect);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
return shape_;
|
return shape_;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,22 +246,26 @@ QPainterPath QetShapeItem::shape() const
|
|||||||
pps.setJoinStyle(Qt::RoundJoin);
|
pps.setJoinStyle(Qt::RoundJoin);
|
||||||
path = pps.createStroke(path);
|
path = pps.createStroke(path);
|
||||||
|
|
||||||
if (isSelected())
|
/**
|
||||||
{
|
Code below is commented to avoid weird bug see : QPainterPath Conductor::shape() const
|
||||||
QVector <QPointF> vector;
|
for more information
|
||||||
|
**/
|
||||||
|
// if (isSelected())
|
||||||
|
// {
|
||||||
|
// QVector <QPointF> vector;
|
||||||
|
|
||||||
if (m_shapeType == Line)
|
// if (m_shapeType == Line)
|
||||||
vector << m_P1 << m_P2;
|
// vector << m_P1 << m_P2;
|
||||||
else if (m_shapeType == Rectangle || m_shapeType == Ellipse) {
|
// else if (m_shapeType == Rectangle || m_shapeType == Ellipse) {
|
||||||
QRectF rect (m_P1, m_P2);
|
// QRectF rect (m_P1, m_P2);
|
||||||
vector << rect.topLeft() << rect.topRight() << rect.bottomRight() << rect.bottomLeft();
|
// vector << rect.topLeft() << rect.topRight() << rect.bottomRight() << rect.bottomLeft();
|
||||||
}
|
// }
|
||||||
else
|
// else
|
||||||
vector = m_polygon;
|
// vector = m_polygon;
|
||||||
|
|
||||||
foreach(QRectF r, m_handler.handlerRect(vector))
|
// foreach(QRectF r, m_handler.handlerRect(vector))
|
||||||
path.addRect(r);
|
// path.addRect(r);
|
||||||
}
|
// }
|
||||||
|
|
||||||
return (path);
|
return (path);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user