| 114 | } |
| 115 | |
| 116 | void |
| 117 | FrequencyCorrectionDialog::paintTextAt( |
| 118 | QPainter &p, |
| 119 | QPointF where, |
| 120 | QString text, |
| 121 | bool center) |
| 122 | { |
| 123 | int tw, th; |
| 124 | QFont font; |
| 125 | |
| 126 | font.setPointSizeF( |
| 127 | FREQUENCY_CORRECTION_DIALOG_OVERSAMPLING * font.pointSizeF()); |
| 128 | |
| 129 | QFontMetrics metrics(font); |
| 130 | QRect rect; |
| 131 | |
| 132 | th = metrics.height(); |
| 133 | |
| 134 | #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) |
| 135 | tw = metrics.horizontalAdvance(text); |
| 136 | #else |
| 137 | tw = metrics.width(text); |
| 138 | #endif // QT_VERSION_CHECK |
| 139 | |
| 140 | if (center) |
| 141 | rect.setRect( |
| 142 | static_cast<int>(where.x() - .5 * tw), |
| 143 | static_cast<int>(where.y() - .5 * th), |
| 144 | tw, |
| 145 | th); |
| 146 | else |
| 147 | rect.setRect( |
| 148 | static_cast<int>(where.x()), |
| 149 | static_cast<int>(where.y() - .5 * th), |
| 150 | tw, |
| 151 | th); |
| 152 | |
| 153 | p.setFont(font); |
| 154 | p.drawText(rect, Qt::AlignLeft | Qt::AlignVCenter, text); |
| 155 | } |
| 156 | |
| 157 | void |
| 158 | FrequencyCorrectionDialog::findNewSatellites(void) |
no test coverage detected