1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

WindowsXP font issue workaround

This commit is contained in:
Martin Tůma 2016-02-13 12:13:56 +01:00
parent 047801685a
commit 2f80e612b5
4 changed files with 21 additions and 17 deletions

View File

@ -21,13 +21,13 @@ ElevationGraph::ElevationGraph(QWidget *parent) : GraphView(parent)
void ElevationGraph::addInfo() void ElevationGraph::addInfo()
{ {
GraphView::addInfo(tr("Ascent"), QString::number(_ascent * _yScale, 'f', 0) GraphView::addInfo(tr("Ascent"), QString::number(_ascent * _yScale, 'f', 0)
+ THIN_SPACE + _yUnits); + UNIT_SPACE + _yUnits);
GraphView::addInfo(tr("Descent"), QString::number(_descent * _yScale, 'f', 0) GraphView::addInfo(tr("Descent"), QString::number(_descent * _yScale, 'f', 0)
+ THIN_SPACE + _yUnits); + UNIT_SPACE + _yUnits);
GraphView::addInfo(tr("Maximum"), QString::number(_max * _yScale, 'f', 0) GraphView::addInfo(tr("Maximum"), QString::number(_max * _yScale, 'f', 0)
+ THIN_SPACE + _yUnits); + UNIT_SPACE + _yUnits);
GraphView::addInfo(tr("Minimum"), QString::number(_min * _yScale, 'f', 0) GraphView::addInfo(tr("Minimum"), QString::number(_min * _yScale, 'f', 0)
+ THIN_SPACE + _yUnits); + UNIT_SPACE + _yUnits);
} }
void ElevationGraph::loadGPX(const GPX &gpx) void ElevationGraph::loadGPX(const GPX &gpx)

View File

@ -519,28 +519,28 @@ void GUI::saveFile(const QString &fileName)
InfoItem info; InfoItem info;
if (_imperialUnitsAction->isChecked()) { if (_imperialUnitsAction->isChecked()) {
info.insert(tr("Distance"), QString::number(_distance * M2MI, 'f', 1) info.insert(tr("Distance"), QString::number(_distance * M2MI, 'f', 1)
+ THIN_SPACE + tr("mi")); + UNIT_SPACE + tr("mi"));
info.insert(tr("Time"), timeSpan(_time)); info.insert(tr("Time"), timeSpan(_time));
info.insert(tr("Ascent"), QString::number(_elevationGraph->ascent() info.insert(tr("Ascent"), QString::number(_elevationGraph->ascent()
* M2FT, 'f', 0) + THIN_SPACE + tr("ft")); * M2FT, 'f', 0) + UNIT_SPACE + tr("ft"));
info.insert(tr("Descent"), QString::number(_elevationGraph->descent() info.insert(tr("Descent"), QString::number(_elevationGraph->descent()
* M2FT, 'f', 0) + THIN_SPACE + tr("ft")); * M2FT, 'f', 0) + UNIT_SPACE + tr("ft"));
info.insert(tr("Maximum"), QString::number(_elevationGraph->max() info.insert(tr("Maximum"), QString::number(_elevationGraph->max()
* M2FT, 'f', 0) + THIN_SPACE + tr("ft")); * M2FT, 'f', 0) + UNIT_SPACE + tr("ft"));
info.insert(tr("Minimum"), QString::number(_elevationGraph->min() info.insert(tr("Minimum"), QString::number(_elevationGraph->min()
* M2FT, 'f', 0) + THIN_SPACE + tr("ft")); * M2FT, 'f', 0) + UNIT_SPACE + tr("ft"));
} else { } else {
info.insert(tr("Distance"), QString::number(_distance * M2KM, 'f', 1) info.insert(tr("Distance"), QString::number(_distance * M2KM, 'f', 1)
+ THIN_SPACE + tr("km")); + UNIT_SPACE + tr("km"));
info.insert(tr("Time"), timeSpan(_time)); info.insert(tr("Time"), timeSpan(_time));
info.insert(tr("Ascent"), QString::number(_elevationGraph->ascent(), info.insert(tr("Ascent"), QString::number(_elevationGraph->ascent(),
'f', 0) + THIN_SPACE + tr("m")); 'f', 0) + UNIT_SPACE + tr("m"));
info.insert(tr("Descent"), QString::number(_elevationGraph->descent(), info.insert(tr("Descent"), QString::number(_elevationGraph->descent(),
'f', 0) + THIN_SPACE + tr("m")); 'f', 0) + UNIT_SPACE + tr("m"));
info.insert(tr("Maximum"), QString::number(_elevationGraph->max(), 'f', info.insert(tr("Maximum"), QString::number(_elevationGraph->max(), 'f',
0) + THIN_SPACE + tr("m")); 0) + UNIT_SPACE + tr("m"));
info.insert(tr("Minimum"), QString::number(_elevationGraph->min(), 'f', info.insert(tr("Minimum"), QString::number(_elevationGraph->min(), 'f',
0) + THIN_SPACE + tr("m")); 0) + UNIT_SPACE + tr("m"));
} }
scene.addItem(&info); scene.addItem(&info);
scene.render(&p, QRectF(0, 0, printer.width(), 200)); scene.render(&p, QRectF(0, 0, printer.width(), 200));

View File

@ -19,9 +19,9 @@ SpeedGraph::SpeedGraph(QWidget *parent) : GraphView(parent)
void SpeedGraph::addInfo() void SpeedGraph::addInfo()
{ {
GraphView::addInfo(tr("Average"), QString::number(avg() * _yScale, 'f', 1) GraphView::addInfo(tr("Average"), QString::number(avg() * _yScale, 'f', 1)
+ THIN_SPACE + _yUnits); + UNIT_SPACE + _yUnits);
GraphView::addInfo(tr("Maximum"), QString::number(_max * _yScale, 'f', 1) GraphView::addInfo(tr("Maximum"), QString::number(_max * _yScale, 'f', 1)
+ THIN_SPACE + _yUnits); + UNIT_SPACE + _yUnits);
} }
void SpeedGraph::loadGPX(const GPX &gpx) void SpeedGraph::loadGPX(const GPX &gpx)

View File

@ -16,6 +16,10 @@ enum Units {
#define MIINFT 5280 // 1 mi in ft #define MIINFT 5280 // 1 mi in ft
#define KMINM 1000 // 1 km in m #define KMINM 1000 // 1 km in m
#define THIN_SPACE QString::fromUtf8("\xE2\x80\x89") #ifdef Q_OS_WIN32
#define UNIT_SPACE " "
#else // Q_OS_WIN32
#define UNIT_SPACE QString::fromUtf8("\xE2\x80\x89")
#endif // Q_OS_WIN32
#endif // UNITS_H #endif // UNITS_H