mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-06 05:10:52 +01:00
Replace foreach function by for, please try and report problem
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4900 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -219,7 +219,7 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
||||
|
||||
//Check each pair of style
|
||||
QRegExp rx("^\\s*([a-z-]+)\\s*:\\s*([a-z-]+)\\s*$");
|
||||
foreach (QString style, styles)
|
||||
for (QString style: styles)
|
||||
{
|
||||
if (!rx.exactMatch(style)) continue;
|
||||
QString style_name = rx.cap(1);
|
||||
|
||||
@@ -129,7 +129,7 @@ QList<QPointF> CustomElementPart::mapPoints(const QRectF &initial_selection_rect
|
||||
qreal new_top_left_x = new_selection_rect.x();
|
||||
qreal new_top_left_y = new_selection_rect.y();
|
||||
|
||||
foreach (QPointF point, points) {
|
||||
for (QPointF point: points) {
|
||||
QPointF point_offset = point - initial_top_left;
|
||||
new_points << QPointF(
|
||||
new_top_left_x + (point_offset.rx() * sx),
|
||||
|
||||
@@ -133,7 +133,7 @@ QRectF PartArc::boundingRect() const
|
||||
{
|
||||
QRectF r = AbstractPartEllipse::boundingRect();
|
||||
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
for (QRectF rect: m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
r |= rect;
|
||||
|
||||
return r;
|
||||
@@ -154,7 +154,7 @@ QPainterPath PartArc::shape() const
|
||||
shape = pps.createStroke(shape);
|
||||
|
||||
if (isSelected())
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
for (QRectF rect: m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
shape.addRect(rect);
|
||||
|
||||
return shape;
|
||||
|
||||
@@ -129,7 +129,7 @@ QRectF PartEllipse::boundingRect() const
|
||||
{
|
||||
QRectF r = AbstractPartEllipse::boundingRect();
|
||||
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
for (QRectF rect: m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
r |= rect;
|
||||
|
||||
return r;
|
||||
@@ -149,7 +149,7 @@ QPainterPath PartEllipse::shape() const
|
||||
shape = pps.createStroke(shape);
|
||||
|
||||
if (isSelected())
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
for (QRectF rect: m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
shape.addRect(rect);
|
||||
|
||||
return shape;
|
||||
|
||||
@@ -244,7 +244,7 @@ QPainterPath PartLine::shape() const
|
||||
shape = pps.createStroke(shape);
|
||||
|
||||
if (isSelected())
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForLine(m_line)))
|
||||
for (QRectF rect: m_handler.handlerRect(m_handler.pointsForLine(m_line)))
|
||||
shape.addRect(rect);
|
||||
|
||||
return shape;
|
||||
@@ -373,10 +373,10 @@ void PartLine::debugPaint(QPainter *painter)
|
||||
|
||||
painter -> setPen(Qt::red);
|
||||
|
||||
foreach(QPointF pointy, fourEndPoints(m_line.p1(), m_line.p2(), first_length))
|
||||
for (QPointF pointy: fourEndPoints(m_line.p1(), m_line.p2(), first_length))
|
||||
painter -> drawEllipse(pointy, 0.1, 0.1);
|
||||
|
||||
foreach(QPointF pointy, fourEndPoints(m_line.p2(), m_line.p1(), second_length))
|
||||
for (QPointF pointy: fourEndPoints(m_line.p2(), m_line.p1(), second_length))
|
||||
painter -> drawEllipse(pointy, 0.1, 0.1);
|
||||
|
||||
painter -> restore();
|
||||
@@ -402,7 +402,7 @@ QRectF PartLine::boundingRect() const
|
||||
bound = bound.normalized();
|
||||
bound.adjust(-adjust, -adjust, adjust, adjust);
|
||||
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForLine(m_line)))
|
||||
for (QRectF rect: m_handler.handlerRect(m_handler.pointsForLine(m_line)))
|
||||
bound |= rect;
|
||||
|
||||
return bound;
|
||||
|
||||
@@ -109,7 +109,7 @@ const QDomElement PartPolygon::toXml(QDomDocument &xml_document) const
|
||||
{
|
||||
QDomElement xml_element = xml_document.createElement("polygon");
|
||||
int i = 1;
|
||||
foreach(QPointF point, m_polygon) {
|
||||
for (QPointF point: m_polygon) {
|
||||
point = mapToScene(point);
|
||||
xml_element.setAttribute(QString("x%1").arg(i), QString("%1").arg(point.x()));
|
||||
xml_element.setAttribute(QString("y%1").arg(i), QString("%1").arg(point.y()));
|
||||
@@ -344,7 +344,7 @@ QPainterPath PartPolygon::shape() const
|
||||
shape = pps.createStroke(shape);
|
||||
|
||||
if (isSelected())
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_polygon))
|
||||
for (QRectF rect: m_handler.handlerRect(m_polygon))
|
||||
shape.addRect(rect);
|
||||
|
||||
return shape;
|
||||
@@ -379,7 +379,7 @@ QRectF PartPolygon::boundingRect() const
|
||||
|
||||
r.adjust(-adjust, -adjust, adjust, adjust);
|
||||
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_polygon))
|
||||
for (QRectF rect: m_handler.handlerRect(m_polygon))
|
||||
r |=rect;
|
||||
|
||||
return(r);
|
||||
|
||||
@@ -165,7 +165,7 @@ QPainterPath PartRectangle::shape() const
|
||||
shape = pps.createStroke(shape);
|
||||
|
||||
if (isSelected())
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
for (QRectF rect: m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
shape.addRect(rect);
|
||||
|
||||
return shape;
|
||||
@@ -196,7 +196,7 @@ QRectF PartRectangle::boundingRect() const
|
||||
QRectF r = m_rect.normalized();
|
||||
r.adjust(-adjust, -adjust, adjust, adjust);
|
||||
|
||||
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
for (QRectF rect: m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
|
||||
r |= rect;
|
||||
|
||||
return(r);
|
||||
|
||||
Reference in New Issue
Block a user