| 116 | } |
| 117 | |
| 118 | void |
| 119 | LocationConfigTab::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 | |
| 141 | Suscan::Location |
| 142 | LocationConfigTab::getLocation(void) const |
no test coverage detected