mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-03 22:39:15 +02:00
Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
4cb369d2f3 | |||
f7b44b64b0 | |||
895b2219c5 | |||
0ec265e4ea | |||
d9e5fc6a74 | |||
c3f345c7f9 | |||
1f9bff6a9b | |||
7e39a34d0e | |||
a941a7315e | |||
cf4f9b6f98 | |||
3d89d0d7da | |||
9b3ed7ef1d | |||
796107b1ab | |||
a7e9c95ba2 | |||
cd54d2d952 | |||
031ed4907c | |||
7cdbad3e79 | |||
b62ec2429a | |||
10032000b1 | |||
fd19d9c5a4 |
@ -1,4 +1,4 @@
|
|||||||
version: 8.0.{build}
|
version: 8.1.{build}
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
|
@ -18,7 +18,7 @@ GPXSee is a Qt-based GPS log file viewer and analyzer that supports all common G
|
|||||||
|
|
||||||
## Build
|
## Build
|
||||||
Build requirements:
|
Build requirements:
|
||||||
* Qt5 >= 5.12 or Qt 6.x
|
* Qt5 >= 5.11 or Qt 6.x
|
||||||
* C++11 or newer compiler (tested: msvc2017, gcc 7.5.0, clang/Apple LLVM version 10.0.0)
|
* C++11 or newer compiler (tested: msvc2017, gcc 7.5.0, clang/Apple LLVM version 10.0.0)
|
||||||
|
|
||||||
Build steps:
|
Build steps:
|
||||||
|
@ -3,7 +3,7 @@ unix:!macx {
|
|||||||
} else {
|
} else {
|
||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
}
|
}
|
||||||
VERSION = 8.0
|
VERSION = 8.1
|
||||||
|
|
||||||
QT += core \
|
QT += core \
|
||||||
gui \
|
gui \
|
||||||
|
@ -1143,12 +1143,12 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
|
||||||
<source>Input</source>
|
<source>Input</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Syöte</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
|
||||||
<source>Output</source>
|
<source>Output</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Tuloste</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="127"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="127"/>
|
||||||
|
@ -811,6 +811,7 @@
|
|||||||
<source>%n files</source>
|
<source>%n files</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n fájl</numerusform>
|
<numerusform>%n fájl</numerusform>
|
||||||
|
<numerusform>%n fájl</numerusform>
|
||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
@ -1055,17 +1056,17 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="84"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="84"/>
|
||||||
<source>Select the proper projection of JNX and KMZ maps. Both EPSG:3857 and EPSG:4326 projected maps exist and there is no projection info in the map file.</source>
|
<source>Select the proper projection of JNX and KMZ maps. Both EPSG:3857 and EPSG:4326 projected maps exist and there is no projection info in the map file.</source>
|
||||||
<translation type="unfinished">Válaszd ki a JNX és a KMZ térképek megfelelő vetületét. Mind az EPSG: 3857, mind az EPSG: 4326 vetületi térképek rendelkezésre állnak, a térkép fájlban nincsenek vetületi információk.</translation>
|
<translation>Válaszd ki a JNX és a KMZ térképek megfelelő vetületét. Mind az EPSG: 3857, mind az EPSG: 4326 vetületi térképek rendelkezésre állnak, a térkép fájlban nincsenek vetületi információk.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
|
||||||
<source>Input</source>
|
<source>Input</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Bemenet</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
|
||||||
<source>Output</source>
|
<source>Output</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Kimenet</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="152"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="152"/>
|
||||||
|
@ -1144,22 +1144,22 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
|
||||||
<source>Input</source>
|
<source>Input</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Ввод</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
|
||||||
<source>Output</source>
|
<source>Output</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Вывод</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="127"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="127"/>
|
||||||
<source>Input:</source>
|
<source>Input:</source>
|
||||||
<translation>Вход:</translation>
|
<translation>Ввод:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="130"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="130"/>
|
||||||
<source>Output:</source>
|
<source>Output:</source>
|
||||||
<translation>Выход:</translation>
|
<translation>Вывод:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="151"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="151"/>
|
||||||
|
@ -811,6 +811,7 @@
|
|||||||
<source>%n files</source>
|
<source>%n files</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n dosya</numerusform>
|
<numerusform>%n dosya</numerusform>
|
||||||
|
<numerusform>%n dosya</numerusform>
|
||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
@ -1075,12 +1076,12 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="118"/>
|
||||||
<source>Input</source>
|
<source>Input</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Girdi</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="120"/>
|
||||||
<source>Output</source>
|
<source>Output</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation>Çıktı</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/GUI/optionsdialog.cpp" line="168"/>
|
<location filename="../src/GUI/optionsdialog.cpp" line="168"/>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "8.0"
|
!define VERSION "8.1"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}.exe"
|
OutFile "GPXSee-${VERSION}.exe"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "8.0"
|
!define VERSION "8.1"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
|
@ -18,9 +18,9 @@ void InfoItem::updateBoundingRect()
|
|||||||
|
|
||||||
for (QList<KV<QString, QString> >::const_iterator i = _list.constBegin();
|
for (QList<KV<QString, QString> >::const_iterator i = _list.constBegin();
|
||||||
i != _list.constEnd(); i++) {
|
i != _list.constEnd(); i++) {
|
||||||
width += fm.boundingRect(i->key() + ": ").width();
|
width += fm.horizontalAdvance(i->key() + ": " + i->value());
|
||||||
width += fm.boundingRect(i->value()).width()
|
if (i != _list.constEnd() - 1)
|
||||||
+ ((i == _list.constEnd() - 1) ? 0 : PADDING);
|
width += PADDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
_boundingRect = QRectF(0, 0, width, _list.isEmpty() ? 0 : fm.height());
|
_boundingRect = QRectF(0, 0, width, _list.isEmpty() ? 0 : fm.height());
|
||||||
@ -39,12 +39,11 @@ void InfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||||||
|
|
||||||
for (QList<KV<QString, QString> >::const_iterator i = _list.constBegin();
|
for (QList<KV<QString, QString> >::const_iterator i = _list.constBegin();
|
||||||
i != _list.constEnd(); i++) {
|
i != _list.constEnd(); i++) {
|
||||||
painter->drawText(width, fm.height() - fm.descent(), i->key() + ": ");
|
QString text(i->key() + ": " + i->value());
|
||||||
width += fm.boundingRect(i->key() + ": ").width();
|
painter->drawText(width, fm.height() - fm.descent(), text);
|
||||||
painter->drawText(width, fm.height() - fm.descent(), i->value());
|
width += fm.horizontalAdvance(text);
|
||||||
width += fm.boundingRect(i->value()).width()
|
|
||||||
+ ((i == _list.constEnd() - 1) ? 0 : PADDING);
|
|
||||||
if (i != _list.constEnd() - 1) {
|
if (i != _list.constEnd() - 1) {
|
||||||
|
width += PADDING;
|
||||||
painter->save();
|
painter->save();
|
||||||
painter->setPen(Qt::gray);
|
painter->setPen(Qt::gray);
|
||||||
painter->drawLine(width - PADDING/2, fm.descent(),
|
painter->drawLine(width - PADDING/2, fm.descent(),
|
||||||
|
@ -515,10 +515,8 @@ void MapView::digitalZoom(int zoom)
|
|||||||
_coordinates->setDigitalZoom(_digitalZoom);
|
_coordinates->setDigitalZoom(_digitalZoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::zoom(int zoom, const QPoint &pos)
|
void MapView::zoom(int zoom, const QPoint &pos, bool shift)
|
||||||
{
|
{
|
||||||
bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
|
|
||||||
|
|
||||||
if (_digitalZoom) {
|
if (_digitalZoom) {
|
||||||
if (((_digitalZoom > 0 && zoom > 0) && (!shift || _digitalZoom
|
if (((_digitalZoom > 0 && zoom > 0) && (!shift || _digitalZoom
|
||||||
>= MAX_DIGITAL_ZOOM)) || ((_digitalZoom < 0 && zoom < 0) && (!shift
|
>= MAX_DIGITAL_ZOOM)) || ((_digitalZoom < 0 && zoom < 0) && (!shift
|
||||||
@ -544,21 +542,28 @@ void MapView::zoom(int zoom, const QPoint &pos)
|
|||||||
void MapView::wheelEvent(QWheelEvent *event)
|
void MapView::wheelEvent(QWheelEvent *event)
|
||||||
{
|
{
|
||||||
static int deg = 0;
|
static int deg = 0;
|
||||||
|
bool shift = (event->modifiers() & MODIFIER) ? true : false;
|
||||||
|
// Shift inverts the wheel axis on OS X, so use scrolling in both axes for
|
||||||
|
// the zoom.
|
||||||
|
int delta = event->angleDelta().y()
|
||||||
|
? event->angleDelta().y() : event->angleDelta().x();
|
||||||
|
|
||||||
deg += event->angleDelta().y() / 8;
|
deg += delta / 8;
|
||||||
if (qAbs(deg) < 15)
|
if (qAbs(deg) < 15)
|
||||||
return;
|
return;
|
||||||
deg = 0;
|
deg = 0;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||||
zoom((event->angleDelta().y() > 0) ? 1 : -1, event->pos());
|
zoom((delta > 0) ? 1 : -1, event->pos(), shift);
|
||||||
#else // QT 5.15
|
#else // QT 5.15
|
||||||
zoom((event->angleDelta().y() > 0) ? 1 : -1, event->position().toPoint());
|
zoom((delta > 0) ? 1 : -1, event->position().toPoint(), shift);
|
||||||
#endif // QT 5.15
|
#endif // QT 5.15
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::mouseDoubleClickEvent(QMouseEvent *event)
|
void MapView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
bool shift = (event->modifiers() & MODIFIER) ? true : false;
|
||||||
|
|
||||||
QGraphicsView::mouseDoubleClickEvent(event);
|
QGraphicsView::mouseDoubleClickEvent(event);
|
||||||
if (event->isAccepted())
|
if (event->isAccepted())
|
||||||
return;
|
return;
|
||||||
@ -566,13 +571,13 @@ void MapView::mouseDoubleClickEvent(QMouseEvent *event)
|
|||||||
if (event->button() != Qt::LeftButton && event->button() != Qt::RightButton)
|
if (event->button() != Qt::LeftButton && event->button() != Qt::RightButton)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
zoom((event->button() == Qt::LeftButton) ? 1 : -1, event->pos());
|
zoom((event->button() == Qt::LeftButton) ? 1 : -1, event->pos(), shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::keyPressEvent(QKeyEvent *event)
|
void MapView::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
int z;
|
int z;
|
||||||
|
bool shift = (event->modifiers() & MODIFIER) ? true : false;
|
||||||
QPoint pos = viewport()->rect().center();
|
QPoint pos = viewport()->rect().center();
|
||||||
|
|
||||||
if (event->key() == ZOOM_IN)
|
if (event->key() == ZOOM_IN)
|
||||||
@ -592,7 +597,7 @@ void MapView::keyPressEvent(QKeyEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
zoom(z, pos);
|
zoom(z, pos, shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::keyReleaseEvent(QKeyEvent *event)
|
void MapView::keyReleaseEvent(QKeyEvent *event)
|
||||||
|
@ -123,7 +123,7 @@ private:
|
|||||||
QPointF contentCenter() const;
|
QPointF contentCenter() const;
|
||||||
void rescale();
|
void rescale();
|
||||||
void centerOn(const QPointF &pos);
|
void centerOn(const QPointF &pos);
|
||||||
void zoom(int zoom, const QPoint &pos);
|
void zoom(int zoom, const QPoint &pos, bool shift);
|
||||||
void digitalZoom(int zoom);
|
void digitalZoom(int zoom);
|
||||||
void updatePOIVisibility();
|
void updatePOIVisibility();
|
||||||
void skipColor() {_palette.nextColor();}
|
void skipColor() {_palette.nextColor();}
|
||||||
|
@ -68,13 +68,12 @@ inline QDataStream &operator>>(QDataStream &in, TimeZoneInfo &info)
|
|||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG
|
// Required in Qt6 even in release builds
|
||||||
inline QDebug operator<<(QDebug dbg, const TimeZoneInfo &info)
|
inline QDebug operator<<(QDebug dbg, const TimeZoneInfo &info)
|
||||||
{
|
{
|
||||||
dbg.nospace() << "TimeZoneInfo(" << static_cast<int>(info._type)
|
dbg.nospace() << "TimeZoneInfo(" << static_cast<int>(info._type)
|
||||||
<< ", " << info._customZone << ")";
|
<< ", " << info._customZone << ")";
|
||||||
return dbg.space();
|
return dbg.space();
|
||||||
}
|
}
|
||||||
#endif // QT_NO_DEBUG
|
|
||||||
|
|
||||||
#endif // TIMEZONEINFO_H
|
#endif // TIMEZONEINFO_H
|
||||||
|
@ -1,7 +1,21 @@
|
|||||||
|
/*
|
||||||
|
WARNING: This code uses internal Qt API - the QZipReader class for reading
|
||||||
|
ZIP files - and things may break if Qt changes the API. For Qt5 this is not
|
||||||
|
a problem as we can "see the future" now and there are no changes in all
|
||||||
|
the supported Qt5 versions up to the last one (5.15). In Qt6 the class
|
||||||
|
might change or even disappear in the future, but this is very unlikely
|
||||||
|
as there were no changes for several years and The Qt Company's policy
|
||||||
|
is: "do not invest any resources into any desktop related stuff unless
|
||||||
|
absolutely necessary". There is an issue (QTBUG-3897) since the year 2009 to
|
||||||
|
include the ZIP reader into the public API, which aptly illustrates the
|
||||||
|
effort The Qt Company is willing to make about anything desktop related...
|
||||||
|
*/
|
||||||
|
|
||||||
#include <QtEndian>
|
#include <QtEndian>
|
||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <private/qzipreader_p.h>
|
||||||
#include "common/coordinates.h"
|
#include "common/coordinates.h"
|
||||||
#include "dem.h"
|
#include "dem.h"
|
||||||
|
|
||||||
@ -55,15 +69,19 @@ static qreal height(const Coordinates &c, const QByteArray *data)
|
|||||||
QString DEM::_dir;
|
QString DEM::_dir;
|
||||||
QCache<DEM::Key, QByteArray> DEM::_data;
|
QCache<DEM::Key, QByteArray> DEM::_data;
|
||||||
|
|
||||||
QString DEM::fileName(const Key &key)
|
QString DEM::baseName(const Key &key)
|
||||||
{
|
{
|
||||||
const char ns = (key.lat() >= 0) ? 'N' : 'S';
|
const char ns = (key.lat() >= 0) ? 'N' : 'S';
|
||||||
const char ew = (key.lon() >= 0) ? 'E' : 'W';
|
const char ew = (key.lon() >= 0) ? 'E' : 'W';
|
||||||
|
|
||||||
QString basename = QString("%1%2%3%4.hgt").arg(ns)
|
return QString("%1%2%3%4.hgt").arg(ns)
|
||||||
.arg(qAbs(key.lat()), 2, 10, QChar('0')).arg(ew)
|
.arg(qAbs(key.lat()), 2, 10, QChar('0')).arg(ew)
|
||||||
.arg(qAbs(key.lon()), 3, 10, QChar('0'));
|
.arg(qAbs(key.lon()), 3, 10, QChar('0'));
|
||||||
return QDir(_dir).absoluteFilePath(basename);
|
}
|
||||||
|
|
||||||
|
QString DEM::fileName(const QString &baseName)
|
||||||
|
{
|
||||||
|
return QDir(_dir).absoluteFilePath(baseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DEM::setDir(const QString &path)
|
void DEM::setDir(const QString &path)
|
||||||
@ -80,7 +98,18 @@ qreal DEM::elevation(const Coordinates &c)
|
|||||||
|
|
||||||
QByteArray *ba = _data[k];
|
QByteArray *ba = _data[k];
|
||||||
if (!ba) {
|
if (!ba) {
|
||||||
QFile file(fileName(k));
|
QString bn(baseName(k));
|
||||||
|
QString fn(fileName(bn));
|
||||||
|
QString zn(fn + ".zip");
|
||||||
|
|
||||||
|
if (QFileInfo::exists(zn)) {
|
||||||
|
QZipReader zip(zn, QIODevice::ReadOnly);
|
||||||
|
ba = new QByteArray(zip.fileData(bn));
|
||||||
|
qreal ele = height(c, ba);
|
||||||
|
_data.insert(k, ba);
|
||||||
|
return ele;
|
||||||
|
} else {
|
||||||
|
QFile file(fn);
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
qWarning("%s: %s", qPrintable(file.fileName()),
|
qWarning("%s: %s", qPrintable(file.fileName()),
|
||||||
qPrintable(file.errorString()));
|
qPrintable(file.errorString()));
|
||||||
@ -92,6 +121,7 @@ qreal DEM::elevation(const Coordinates &c)
|
|||||||
_data.insert(k, ba);
|
_data.insert(k, ba);
|
||||||
return ele;
|
return ele;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
return height(c, ba);
|
return height(c, ba);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,8 @@ private:
|
|||||||
int _lon, _lat;
|
int _lon, _lat;
|
||||||
};
|
};
|
||||||
|
|
||||||
static QString fileName(const Key &key);
|
static QString baseName(const Key &key);
|
||||||
|
static QString fileName(const QString &baseName);
|
||||||
|
|
||||||
static QString _dir;
|
static QString _dir;
|
||||||
static QCache<Key, QByteArray> _data;
|
static QCache<Key, QByteArray> _data;
|
||||||
|
Reference in New Issue
Block a user