Revert "Try Clazy fix-its"

Segfault on old Qt versions!
This reverts commit dba7caed30.
This commit is contained in:
Laurent Trinques
2025-02-14 16:17:58 +01:00
parent dba7caed30
commit 43f0107eb1
88 changed files with 409 additions and 512 deletions

View File

@@ -803,7 +803,7 @@ void Conductor::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSc
m_moved_segment = segmentsList().at(m_vector_index+1);
before_mov_text_pos_ = m_text_item -> pos();
for (QetGraphicsHandlerItem* handler : std::as_const(m_handler_vector))
for(QetGraphicsHandlerItem *handler : m_handler_vector)
if(handler != qghi)
handler->hide();
}
@@ -871,7 +871,7 @@ void Conductor::addHandler()
{
m_handler_vector = QetGraphicsHandlerItem::handlerForPoint(mapToScene(handlerPoints()), QETUtils::graphicsHandlerSize(this));
for (QetGraphicsHandlerItem* handler : std::as_const(m_handler_vector))
for(QetGraphicsHandlerItem *handler : m_handler_vector)
{
handler->setColor(Qt::blue);
scene()->addItem(handler);
@@ -1703,7 +1703,7 @@ QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram,
this_terminal << terminal1 << terminal2;
// Return all conductors of terminal 1 and 2
for (Terminal* terminal : std::as_const(this_terminal))
for (Terminal *terminal : this_terminal)
{
if (!t_list->contains(terminal))
{
@@ -1723,8 +1723,7 @@ QSet<Conductor *> Conductor::relatedPotentialConductors(const bool all_diagram,
other_conductors_list_t.removeAll(this);
//Get the conductors at the same potential for each conductors of other_conductors_list_t
for (Conductor* c : std::as_const(other_conductors_list_t))
{
for (Conductor *c : other_conductors_list_t) {
other_conductors += c->relatedPotentialConductors(all_diagram, t_list);
}
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
@@ -2017,7 +2016,7 @@ QPointF Conductor::movePointIntoPolygon(const QPointF &point, const QPainterPath
QList<QLineF> lines;
QList<QPointF> points;
for (const QPolygonF& polygon : polygons)
for (QPolygonF polygon : polygons)
{
if (polygon.count() <= 1)
continue;
@@ -2032,7 +2031,7 @@ QPointF Conductor::movePointIntoPolygon(const QPointF &point, const QPainterPath
// we make orthogonal projections of the point on the different
// segments of the polygon, sorting them by increasing length
QMap<qreal, QPointF> intersections;
for (QLineF line : std::as_const(lines))
for (QLineF line : lines)
{
QPointF intersection_point;
if (QET::orthogonalProjection(point, line, &intersection_point)) {