MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / paintMapCoords

Method paintMapCoords

Settings/LocationConfigTab.cpp:118–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118void
119LocationConfigTab::paintMapCoords(double lat, double lon)
120{
121 QPixmap bg = QPixmap(":/icons/earthmap.png");
122 QSize dim = bg.size();
123 QPainter painter(&bg);
124 int x, y;
125 int hL = dim.width() / 100;
126
127 lat = 90. - lat;
128 lon = lon + 180.;
129
130 y = static_cast<int>(lat * dim.height() / 180.);
131 x = static_cast<int>(lon * dim.width() / 360.);
132
133
134 painter.setPen(QPen(Qt::red, hL / 2));
135 painter.drawLine(x - hL, y - hL, x + hL, y + hL);
136 painter.drawLine(x - hL, y + hL, x + hL, y - hL);
137
138 this->ui->mapLabel->setPixmap(bg);
139}
140
141Suscan::Location
142LocationConfigTab::getLocation(void) const

Callers 2

setLocationMethod · 0.95
onLocationChangedMethod · 0.95

Calls 2

widthMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected