|
@@ -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
|
|