@@ -52,7 +52,7 @@ bool QgsCompoundCurve::operator!=( const QgsCurve &other ) const
52
52
QgsCompoundCurve::QgsCompoundCurve ( const QgsCompoundCurve &curve ): QgsCurve( curve )
53
53
{
54
54
mWkbType = QgsWkbTypes::CompoundCurve;
55
- Q_FOREACH ( const QgsCurve *c, curve.mCurves )
55
+ for ( const QgsCurve *c : curve.mCurves )
56
56
{
57
57
mCurves .append ( static_cast <QgsCurve *>( c->clone () ) );
58
58
}
@@ -64,7 +64,7 @@ QgsCompoundCurve &QgsCompoundCurve::operator=( const QgsCompoundCurve &curve )
64
64
{
65
65
clearCache ();
66
66
QgsCurve::operator =( curve );
67
- Q_FOREACH ( const QgsCurve *c, curve.mCurves )
67
+ for ( const QgsCurve *c : curve.mCurves )
68
68
{
69
69
mCurves .append ( static_cast <QgsCurve *>( c->clone () ) );
70
70
}
@@ -153,7 +153,8 @@ bool QgsCompoundCurve::fromWkt( const QString &wkt )
153
153
154
154
QString defaultChildWkbType = QStringLiteral ( " LineString%1%2" ).arg ( is3D () ? " Z" : QString (), isMeasure () ? " M" : QString () );
155
155
156
- Q_FOREACH ( const QString &childWkt, QgsGeometryUtils::wktGetChildBlocks ( parts.second , defaultChildWkbType ) )
156
+ const QStringList blocks = QgsGeometryUtils::wktGetChildBlocks ( parts.second , defaultChildWkbType );
157
+ for ( const QString &childWkt : blocks )
157
158
{
158
159
QPair<QgsWkbTypes::Type, QString> childParts = QgsGeometryUtils::wktReadBlock ( childWkt );
159
160
@@ -177,7 +178,7 @@ bool QgsCompoundCurve::fromWkt( const QString &wkt )
177
178
// if so, update the type dimensionality of the compound curve to match
178
179
bool hasZ = false ;
179
180
bool hasM = false ;
180
- Q_FOREACH ( const QgsCurve *curve, mCurves )
181
+ for ( const QgsCurve *curve : qgsAsConst ( mCurves ) )
181
182
{
182
183
hasZ = hasZ || curve->is3D ();
183
184
hasM = hasM || curve->isMeasure ();
@@ -196,7 +197,7 @@ QByteArray QgsCompoundCurve::asWkb() const
196
197
{
197
198
int binarySize = sizeof ( char ) + sizeof ( quint32 ) + sizeof ( quint32 );
198
199
QList<QByteArray> wkbForCurves;
199
- Q_FOREACH ( const QgsCurve *curve, mCurves )
200
+ for ( const QgsCurve *curve : mCurves )
200
201
{
201
202
QByteArray wkbForCurve = curve->asWkb ();
202
203
binarySize += wkbForCurve.length ();
@@ -209,7 +210,7 @@ QByteArray QgsCompoundCurve::asWkb() const
209
210
wkb << static_cast <char >( QgsApplication::endian () );
210
211
wkb << static_cast <quint32>( wkbType () );
211
212
wkb << static_cast <quint32>( mCurves .size () );
212
- Q_FOREACH ( const QByteArray &wkbForCurve, wkbForCurves )
213
+ for ( const QByteArray &wkbForCurve : qgsAsConst ( wkbForCurves ) )
213
214
{
214
215
wkb << wkbForCurve;
215
216
}
@@ -219,7 +220,7 @@ QByteArray QgsCompoundCurve::asWkb() const
219
220
QString QgsCompoundCurve::asWkt ( int precision ) const
220
221
{
221
222
QString wkt = wktTypeStr () + " (" ;
222
- Q_FOREACH ( const QgsCurve *curve, mCurves )
223
+ for ( const QgsCurve *curve : mCurves )
223
224
{
224
225
QString childWkt = curve->asWkt ( precision );
225
226
if ( qgsgeometry_cast<const QgsLineString *>( curve ) )
@@ -249,7 +250,7 @@ QDomElement QgsCompoundCurve::asGML2( QDomDocument &doc, int precision, const QS
249
250
QDomElement QgsCompoundCurve::asGML3 ( QDomDocument &doc, int precision, const QString &ns ) const
250
251
{
251
252
QDomElement compoundCurveElem = doc.createElementNS ( ns, QStringLiteral ( " CompositeCurve" ) );
252
- Q_FOREACH ( const QgsCurve *curve, mCurves )
253
+ for ( const QgsCurve *curve : mCurves )
253
254
{
254
255
QDomElement curveMemberElem = doc.createElementNS ( ns, QStringLiteral ( " curveMember" ) );
255
256
QDomElement curveElem = curve->asGML3 ( doc, precision, ns );
@@ -338,7 +339,7 @@ bool QgsCompoundCurve::isEmpty() const
338
339
if ( mCurves .isEmpty () )
339
340
return true ;
340
341
341
- Q_FOREACH ( QgsCurve *curve, mCurves )
342
+ for ( QgsCurve *curve : mCurves )
342
343
{
343
344
if ( !curve->isEmpty () )
344
345
return false ;
@@ -448,7 +449,7 @@ void QgsCompoundCurve::draw( QPainter &p ) const
448
449
449
450
void QgsCompoundCurve::transform ( const QgsCoordinateTransform &ct, QgsCoordinateTransform::TransformDirection d, bool transformZ )
450
451
{
451
- Q_FOREACH ( QgsCurve *curve, mCurves )
452
+ for ( QgsCurve *curve : qgsAsConst ( mCurves ) )
452
453
{
453
454
curve->transform ( ct, d, transformZ );
454
455
}
@@ -457,7 +458,7 @@ void QgsCompoundCurve::transform( const QgsCoordinateTransform &ct, QgsCoordinat
457
458
458
459
void QgsCompoundCurve::transform ( const QTransform &t )
459
460
{
460
- Q_FOREACH ( QgsCurve *curve, mCurves )
461
+ for ( QgsCurve *curve : qgsAsConst ( mCurves ) )
461
462
{
462
463
curve->transform ( t );
463
464
}
@@ -753,7 +754,7 @@ double QgsCompoundCurve::vertexAngle( QgsVertexId vertex ) const
753
754
QgsCompoundCurve *QgsCompoundCurve::reversed () const
754
755
{
755
756
QgsCompoundCurve *clone = new QgsCompoundCurve ();
756
- Q_FOREACH ( QgsCurve *curve, mCurves )
757
+ for ( QgsCurve *curve : mCurves )
757
758
{
758
759
QgsCurve *reversedCurve = curve->reversed ();
759
760
clone->addCurve ( reversedCurve );
@@ -768,7 +769,7 @@ bool QgsCompoundCurve::addZValue( double zValue )
768
769
769
770
mWkbType = QgsWkbTypes::addZ ( mWkbType );
770
771
771
- Q_FOREACH ( QgsCurve *curve, mCurves )
772
+ for ( QgsCurve *curve : qgsAsConst ( mCurves ) )
772
773
{
773
774
curve->addZValue ( zValue );
774
775
}
@@ -783,7 +784,7 @@ bool QgsCompoundCurve::addMValue( double mValue )
783
784
784
785
mWkbType = QgsWkbTypes::addM ( mWkbType );
785
786
786
- Q_FOREACH ( QgsCurve *curve, mCurves )
787
+ for ( QgsCurve *curve : qgsAsConst ( mCurves ) )
787
788
{
788
789
curve->addMValue ( mValue );
789
790
}
@@ -797,7 +798,7 @@ bool QgsCompoundCurve::dropZValue()
797
798
return false ;
798
799
799
800
mWkbType = QgsWkbTypes::dropZ ( mWkbType );
800
- Q_FOREACH ( QgsCurve *curve, mCurves )
801
+ for ( QgsCurve *curve : qgsAsConst ( mCurves ) )
801
802
{
802
803
curve->dropZValue ();
803
804
}
@@ -811,7 +812,7 @@ bool QgsCompoundCurve::dropMValue()
811
812
return false ;
812
813
813
814
mWkbType = QgsWkbTypes::dropM ( mWkbType );
814
- Q_FOREACH ( QgsCurve *curve, mCurves )
815
+ for ( QgsCurve *curve : qgsAsConst ( mCurves ) )
815
816
{
816
817
curve->dropMValue ();
817
818
}
0 commit comments