mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-27 21:24:47 +01:00
Get rid of QT_NO_DEPRECATED_WARNINGS
This commit is contained in:
parent
592b552721
commit
d750715bed
@ -142,6 +142,7 @@ HEADERS += src/common/config.h \
|
|||||||
src/map/filter.h \
|
src/map/filter.h \
|
||||||
src/map/gemfmap.h \
|
src/map/gemfmap.h \
|
||||||
src/map/gmifile.h \
|
src/map/gmifile.h \
|
||||||
|
src/map/metatype.h \
|
||||||
src/map/oruxmap.h \
|
src/map/oruxmap.h \
|
||||||
src/map/osmdroidmap.h \
|
src/map/osmdroidmap.h \
|
||||||
src/map/proj/polyconic.h \
|
src/map/proj/polyconic.h \
|
||||||
@ -474,8 +475,7 @@ SOURCES += src/main.cpp \
|
|||||||
src/data/smlparser.cpp \
|
src/data/smlparser.cpp \
|
||||||
src/data/geojsonparser.cpp
|
src/data/geojsonparser.cpp
|
||||||
|
|
||||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\" \
|
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||||
QT_NO_DEPRECATED_WARNINGS
|
|
||||||
|
|
||||||
RESOURCES += gpxsee.qrc
|
RESOURCES += gpxsee.qrc
|
||||||
TRANSLATIONS = lang/gpxsee_en.ts \
|
TRANSLATIONS = lang/gpxsee_en.ts \
|
||||||
|
@ -38,9 +38,9 @@ static inline QPoint POS(QMouseEvent *e)
|
|||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
return e->pos();
|
return e->pos();
|
||||||
#else // QT 5.15
|
#else // QT 6
|
||||||
return e->position().toPoint();
|
return e->position().toPoint();
|
||||||
#endif // QT 5.15
|
#endif // QT 6
|
||||||
}
|
}
|
||||||
|
|
||||||
GraphView::GraphView(QWidget *parent)
|
GraphView::GraphView(QWidget *parent)
|
||||||
|
@ -20,16 +20,16 @@
|
|||||||
#define OPEN_SHORTCUT QKeySequence(QKeySequence::Open)
|
#define OPEN_SHORTCUT QKeySequence(QKeySequence::Open)
|
||||||
#define CLOSE_SHORTCUT QKeySequence(QKeySequence::Close)
|
#define CLOSE_SHORTCUT QKeySequence(QKeySequence::Close)
|
||||||
#define RELOAD_SHORTCUT QKeySequence(QKeySequence::Refresh)
|
#define RELOAD_SHORTCUT QKeySequence(QKeySequence::Refresh)
|
||||||
#define PDF_EXPORT_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_E)
|
#define PDF_EXPORT_SHORTCUT QKeySequence(Qt::CTRL | Qt::Key_E)
|
||||||
#define PNG_EXPORT_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_X)
|
#define PNG_EXPORT_SHORTCUT QKeySequence(Qt::CTRL | Qt::Key_X)
|
||||||
#define SHOW_POI_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_P)
|
#define SHOW_POI_SHORTCUT QKeySequence(Qt::CTRL | Qt::Key_P)
|
||||||
#define SHOW_MAP_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_M)
|
#define SHOW_MAP_SHORTCUT QKeySequence(Qt::CTRL | Qt::Key_M)
|
||||||
#define NEXT_MAP_SHORTCUT QKeySequence(QKeySequence::Forward)
|
#define NEXT_MAP_SHORTCUT QKeySequence(QKeySequence::Forward)
|
||||||
#define PREV_MAP_SHORTCUT QKeySequence(QKeySequence::Back)
|
#define PREV_MAP_SHORTCUT QKeySequence(QKeySequence::Back)
|
||||||
#define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G)
|
#define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL | Qt::Key_G)
|
||||||
#define STATISTICS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_S)
|
#define STATISTICS_SHORTCUT QKeySequence(Qt::CTRL | Qt::Key_S)
|
||||||
#define DOWNLOAD_DEM_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_D)
|
#define DOWNLOAD_DEM_SHORTCUT QKeySequence(Qt::CTRL | Qt::Key_D)
|
||||||
#define SHOW_TRACKS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_T)
|
#define SHOW_TRACKS_SHORTCUT QKeySequence(Qt::CTRL | Qt::Key_T)
|
||||||
#define FULLSCREEN_SHORTCUT (QKeySequence(QKeySequence::FullScreen).isEmpty() \
|
#define FULLSCREEN_SHORTCUT (QKeySequence(QKeySequence::FullScreen).isEmpty() \
|
||||||
? QKeySequence(Qt::Key_F11) \
|
? QKeySequence(Qt::Key_F11) \
|
||||||
: QKeySequence(QKeySequence::FullScreen))
|
: QKeySequence(QKeySequence::FullScreen))
|
||||||
|
@ -17,6 +17,14 @@
|
|||||||
#include "flowlayout.h"
|
#include "flowlayout.h"
|
||||||
#include "popup.h"
|
#include "popup.h"
|
||||||
|
|
||||||
|
static inline QPointF mousePos(QEvent *ev)
|
||||||
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
return static_cast<QMouseEvent*>(ev)->globalPos();
|
||||||
|
#else // QT 6
|
||||||
|
return static_cast<QMouseEvent*>(ev)->globalPosition();
|
||||||
|
#endif // QT 6
|
||||||
|
}
|
||||||
|
|
||||||
class PopupFrame : public QFrame
|
class PopupFrame : public QFrame
|
||||||
{
|
{
|
||||||
@ -163,8 +171,7 @@ bool PopupFrame::eventFilter(QObject *o, QEvent *ev)
|
|||||||
break;
|
break;
|
||||||
case QEvent::MouseMove: {
|
case QEvent::MouseMove: {
|
||||||
QRectF r(geometry().adjusted(-5, -20, 5, 20));
|
QRectF r(geometry().adjusted(-5, -20, 5, 20));
|
||||||
QPointF p(static_cast<QMouseEvent*>(ev)->globalPos());
|
if (!r.contains(mousePos(ev)))
|
||||||
if (!r.contains(p))
|
|
||||||
deleteAfterTimer();
|
deleteAfterTimer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "osm.h"
|
#include "osm.h"
|
||||||
|
#include "metatype.h"
|
||||||
#include "mbtilesmap.h"
|
#include "mbtilesmap.h"
|
||||||
|
|
||||||
#define MAX_TILE_SIZE 4096
|
#define MAX_TILE_SIZE 4096
|
||||||
#define META_TYPE(type) static_cast<QMetaType::Type>(type)
|
|
||||||
|
|
||||||
static RectC str2bounds(const QString &str)
|
static RectC str2bounds(const QString &str)
|
||||||
{
|
{
|
||||||
@ -201,13 +201,13 @@ MBTilesMap::MBTilesMap(const QString &fileName, QObject *parent)
|
|||||||
QSqlRecord r = _db.record("tiles");
|
QSqlRecord r = _db.record("tiles");
|
||||||
if (r.isEmpty()
|
if (r.isEmpty()
|
||||||
|| r.field(0).name() != "zoom_level"
|
|| r.field(0).name() != "zoom_level"
|
||||||
|| META_TYPE(r.field(0).type()) != QMetaType::Int
|
|| METATYPE(r.field(0)) != QMetaType::Int
|
||||||
|| r.field(1).name() != "tile_column"
|
|| r.field(1).name() != "tile_column"
|
||||||
|| META_TYPE(r.field(1).type()) != QMetaType::Int
|
|| METATYPE(r.field(1)) != QMetaType::Int
|
||||||
|| r.field(2).name() != "tile_row"
|
|| r.field(2).name() != "tile_row"
|
||||||
|| META_TYPE(r.field(2).type()) != QMetaType::Int
|
|| METATYPE(r.field(2)) != QMetaType::Int
|
||||||
|| r.field(3).name() != "tile_data"
|
|| r.field(3).name() != "tile_data"
|
||||||
|| META_TYPE(r.field(3).type()) != QMetaType::QByteArray) {
|
|| METATYPE(r.field(3)) != QMetaType::QByteArray) {
|
||||||
_errorString = "Invalid table format";
|
_errorString = "Invalid table format";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
15
src/map/metatype.h
Normal file
15
src/map/metatype.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef METATYPE_H
|
||||||
|
#define METATYPE_H
|
||||||
|
|
||||||
|
#include <QSqlField>
|
||||||
|
|
||||||
|
static inline QMetaType::Type METATYPE(const QSqlField &f)
|
||||||
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
return static_cast<QMetaType::Type>(f.type());
|
||||||
|
#else // QT 6
|
||||||
|
return static_cast<QMetaType::Type>(f.metaType().id());
|
||||||
|
#endif // QT 6
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // METATYPE_H
|
@ -9,11 +9,10 @@
|
|||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
#include "pcs.h"
|
#include "pcs.h"
|
||||||
#include "utm.h"
|
#include "utm.h"
|
||||||
|
#include "metatype.h"
|
||||||
#include "oruxmap.h"
|
#include "oruxmap.h"
|
||||||
|
|
||||||
|
|
||||||
#define META_TYPE(type) static_cast<QMetaType::Type>(type)
|
|
||||||
|
|
||||||
static bool intAttr(QXmlStreamReader &reader, const QXmlStreamAttributes &attr,
|
static bool intAttr(QXmlStreamReader &reader, const QXmlStreamAttributes &attr,
|
||||||
const QString &name, int &val)
|
const QString &name, int &val)
|
||||||
{
|
{
|
||||||
@ -431,14 +430,11 @@ OruxMap::OruxMap(const QString &fileName, QObject *parent)
|
|||||||
|
|
||||||
QSqlRecord r = _db.record("tiles");
|
QSqlRecord r = _db.record("tiles");
|
||||||
if (r.isEmpty()
|
if (r.isEmpty()
|
||||||
|| r.field(0).name() != "x"
|
|| r.field(0).name() != "x" || METATYPE(r.field(0)) != QMetaType::Int
|
||||||
|| META_TYPE(r.field(0).type()) != QMetaType::Int
|
|| r.field(1).name() != "y" || METATYPE(r.field(1)) != QMetaType::Int
|
||||||
|| r.field(1).name() != "y"
|
|| r.field(2).name() != "z" || METATYPE(r.field(2)) != QMetaType::Int
|
||||||
|| META_TYPE(r.field(1).type()) != QMetaType::Int
|
|
||||||
|| r.field(2).name() != "z"
|
|
||||||
|| META_TYPE(r.field(2).type()) != QMetaType::Int
|
|
||||||
|| r.field(3).name() != "image"
|
|| r.field(3).name() != "image"
|
||||||
|| META_TYPE(r.field(3).type()) != QMetaType::QByteArray) {
|
|| METATYPE(r.field(3)) != QMetaType::QByteArray) {
|
||||||
_errorString = "Invalid table format";
|
_errorString = "Invalid table format";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
#include "osm.h"
|
#include "osm.h"
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
|
#include "metatype.h"
|
||||||
#include "osmdroidmap.h"
|
#include "osmdroidmap.h"
|
||||||
|
|
||||||
|
|
||||||
#define META_TYPE(type) static_cast<QMetaType::Type>(type)
|
|
||||||
|
|
||||||
OsmdroidMap::OsmdroidMap(const QString &fileName, QObject *parent)
|
OsmdroidMap::OsmdroidMap(const QString &fileName, QObject *parent)
|
||||||
: Map(fileName, parent), _mapRatio(1.0), _valid(false)
|
: Map(fileName, parent), _mapRatio(1.0), _valid(false)
|
||||||
{
|
{
|
||||||
@ -34,11 +33,11 @@ OsmdroidMap::OsmdroidMap(const QString &fileName, QObject *parent)
|
|||||||
QSqlRecord rcrd = _db.record("tiles");
|
QSqlRecord rcrd = _db.record("tiles");
|
||||||
if (rcrd.isEmpty()
|
if (rcrd.isEmpty()
|
||||||
|| rcrd.field(0).name() != "key"
|
|| rcrd.field(0).name() != "key"
|
||||||
|| META_TYPE(rcrd.field(0).type()) != QMetaType::Int
|
|| METATYPE(rcrd.field(0)) != QMetaType::Int
|
||||||
|| rcrd.field(1).name() != "provider"
|
|| rcrd.field(1).name() != "provider"
|
||||||
|| META_TYPE(rcrd.field(1).type()) != QMetaType::QString
|
|| METATYPE(rcrd.field(1)) != QMetaType::QString
|
||||||
|| rcrd.field(2).name() != "tile"
|
|| rcrd.field(2).name() != "tile"
|
||||||
|| META_TYPE(rcrd.field(2).type()) != QMetaType::QByteArray) {
|
|| METATYPE(rcrd.field(2)) != QMetaType::QByteArray) {
|
||||||
_errorString = "Invalid table format";
|
_errorString = "Invalid table format";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,10 @@
|
|||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
#include "osm.h"
|
#include "osm.h"
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
|
#include "metatype.h"
|
||||||
#include "sqlitemap.h"
|
#include "sqlitemap.h"
|
||||||
|
|
||||||
|
|
||||||
#define META_TYPE(type) static_cast<QMetaType::Type>(type)
|
|
||||||
|
|
||||||
SqliteMap::SqliteMap(const QString &fileName, QObject *parent)
|
SqliteMap::SqliteMap(const QString &fileName, QObject *parent)
|
||||||
: Map(fileName, parent), _mapRatio(1.0), _valid(false)
|
: Map(fileName, parent), _mapRatio(1.0), _valid(false)
|
||||||
{
|
{
|
||||||
@ -32,13 +31,13 @@ SqliteMap::SqliteMap(const QString &fileName, QObject *parent)
|
|||||||
QSqlRecord r = _db.record("tiles");
|
QSqlRecord r = _db.record("tiles");
|
||||||
if (r.isEmpty()
|
if (r.isEmpty()
|
||||||
|| r.field(0).name() != "x"
|
|| r.field(0).name() != "x"
|
||||||
|| META_TYPE(r.field(0).type()) != QMetaType::Int
|
|| METATYPE(r.field(0)) != QMetaType::Int
|
||||||
|| r.field(1).name() != "y"
|
|| r.field(1).name() != "y"
|
||||||
|| META_TYPE(r.field(1).type()) != QMetaType::Int
|
|| METATYPE(r.field(1)) != QMetaType::Int
|
||||||
|| r.field(2).name() != "z"
|
|| r.field(2).name() != "z"
|
||||||
|| META_TYPE(r.field(2).type()) != QMetaType::Int
|
|| METATYPE(r.field(2)) != QMetaType::Int
|
||||||
|| r.field(4).name() != "image"
|
|| r.field(4).name() != "image"
|
||||||
|| META_TYPE(r.field(4).type()) != QMetaType::QByteArray) {
|
|| METATYPE(r.field(4)) != QMetaType::QByteArray) {
|
||||||
_errorString = "Invalid table format";
|
_errorString = "Invalid table format";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,15 @@
|
|||||||
#include "tileloader.h"
|
#include "tileloader.h"
|
||||||
|
|
||||||
#define SUBSTITUTE_CHAR '$'
|
#define SUBSTITUTE_CHAR '$'
|
||||||
#define IS_INT(zoom) \
|
|
||||||
((QMetaType::Type)((zoom).type()) == QMetaType::Int)
|
|
||||||
|
|
||||||
|
static bool inline IS_INT(const QVariant &v)
|
||||||
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
return (static_cast<QMetaType::Type>(v.type()) == QMetaType::Int);
|
||||||
|
#else // QT 6
|
||||||
|
return (static_cast<QMetaType::Type>((v.typeId()) == QMetaType::Int));
|
||||||
|
#endif // QT 6
|
||||||
|
}
|
||||||
|
|
||||||
static QString fsSafeStr(const QString &str)
|
static QString fsSafeStr(const QString &str)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user