ソースを参照

Eliminated c++11 for each expression

コミット
9595e1bdbb
共有2 個のファイルを変更した15 個の追加2 個の削除を含む
  1. 14
    1
      map.cpp
  2. 1
    1
      prMap.pro

+ 14
- 1
map.cpp ファイルの表示

@@ -188,6 +188,19 @@ void Map::paintEvent(QPaintEvent *event) {
188 188
         }
189 189
     }
190 190
 
191
+     QVector < QPair<const GISPOI *,const GISPOI *> > ::iterator vit = this->cityLines.begin();
192
+    for (; vit != this->cityLines.end(); vit++) {
193
+
194
+//        qDebug() << "A line from " << linePair.first->getName() << " to " << linePair.second->getName() << endl;
195
+        cX = factorX * (vit->first->getLon() - myCountry->minX);
196
+        cY = height() - factorY*(vit->first->getLat()  - myCountry->minY);
197
+        pX = factorX * (vit->second->getLon() - myCountry->minX);
198
+        pY = height() - factorY*(vit->second->getLat()  - myCountry->minY);
199
+        p->drawLine(pX+circleRadius/2,pY+circleRadius/2,cX+circleRadius/2,cY+circleRadius/2);
200
+    }
201
+
202
+//c++11 way
203
+/*
191 204
     for (QPair<const GISPOI *, const GISPOI *> linePair: this->cityLines) {
192 205
 //        qDebug() << "A line from " << linePair.first->getName() << " to " << linePair.second->getName() << endl;
193 206
         cX = factorX * (linePair.first->getLon() - myCountry->minX);
@@ -196,7 +209,7 @@ void Map::paintEvent(QPaintEvent *event) {
196 209
         pY = height() - factorY*(linePair.second->getLat()  - myCountry->minY);
197 210
         p->drawLine(pX+circleRadius/2,pY+circleRadius/2,cX+circleRadius/2,cY+circleRadius/2);
198 211
     }
199
-
212
+*/
200 213
     delete p;
201 214
 }
202 215
 

+ 1
- 1
prMap.pro ファイルの表示

@@ -11,7 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
11 11
 TARGET = prMap
12 12
 TEMPLATE = app
13 13
 
14
-CONFIG += c++11
14
+# CONFIG += c++11
15 15
 
16 16
 SOURCES += main.cpp\
17 17
         mainwindow.cpp \