File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -399,20 +399,18 @@ void QgsRubberBand::setToCanvasRectangle( const QRect& rect )
399
399
*/
400
400
void QgsRubberBand::paint ( QPainter* p )
401
401
{
402
- QList<QgsPoint> currentList;
403
402
if ( mPoints .size () > 0 )
404
403
{
405
404
p->setBrush ( mBrush );
406
405
mPen .setWidth ( mWidth );
407
406
p->setPen ( mPen );
408
407
409
- for ( int i = 0 ; i < mPoints . size (); ++i )
408
+ Q_FOREACH ( const QList<QgsPoint>& line, mPoints )
410
409
{
411
410
QVector<QPointF> pts;
412
- QList<QgsPoint>::const_iterator it = mPoints .at ( i ).constBegin ();
413
- for ( ; it != mPoints .at ( i ).constEnd (); ++it )
411
+ Q_FOREACH ( const QgsPoint& pt, line )
414
412
{
415
- const QPointF cur = toCanvasCoordinates ( QgsPoint ( it-> x () + mTranslationOffsetX , it-> y () + mTranslationOffsetY ) ) - pos ();
413
+ const QPointF cur = toCanvasCoordinates ( QgsPoint ( pt. x () + mTranslationOffsetX , pt. y () + mTranslationOffsetY ) ) - pos ();
416
414
if ( pts.empty () || std::abs ( pts.back ().x () - cur.x () ) > 1 || std::abs ( pts.back ().y () - cur.y () ) > 1 )
417
415
pts.append ( cur );
418
416
}
@@ -427,11 +425,10 @@ void QgsRubberBand::paint( QPainter* p )
427
425
428
426
case QGis::Point:
429
427
{
430
- QVector<QPointF>::const_iterator ptIt = pts.constBegin ();
431
- for ( ; ptIt != pts.constEnd (); ++ptIt )
428
+ Q_FOREACH ( const QPointF& pt, pts )
432
429
{
433
- double x = ( *ptIt ) .x ();
434
- double y = ( *ptIt ) .y ();
430
+ double x = pt .x ();
431
+ double y = pt .y ();
435
432
436
433
qreal s = ( mIconSize - 1 ) / 2 ;
437
434
You can’t perform that action at this time.
0 commit comments