summaryrefslogtreecommitdiff
path: root/platform/qt/app
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2018-11-12 16:38:34 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2018-11-13 22:55:26 +0200
commitcd92a231b3e11c65321a48d0167898bb0e5a5fa8 (patch)
treef821513781bee5b9039945489d1fe926c8900a6d /platform/qt/app
parentb891a8d6b0dc9e92a283756448b4671bef3da71f (diff)
downloadqtlocation-mapboxgl-cd92a231b3e11c65321a48d0167898bb0e5a5fa8.tar.gz
[qt] Deprecate Qt4 and old versions of Qt5
Not enough adoption to keep the platform alive.
Diffstat (limited to 'platform/qt/app')
-rw-r--r--platform/qt/app/mapwindow.cpp29
-rw-r--r--platform/qt/app/mapwindow.hpp13
2 files changed, 1 insertions, 41 deletions
diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp
index 536731929e..551af4630b 100644
--- a/platform/qt/app/mapwindow.cpp
+++ b/platform/qt/app/mapwindow.cpp
@@ -9,13 +9,8 @@
#include <QMouseEvent>
#include <QString>
-#if QT_VERSION >= 0x050000
-#include <QWindow>
-#endif
-
int kAnimationDuration = 10000;
-
MapWindow::MapWindow(const QMapboxGLSettings &settings)
: m_settings(settings)
{
@@ -45,13 +40,7 @@ void MapWindow::selfTest()
}
qreal MapWindow::pixelRatio() {
-#if QT_VERSION >= 0x050600
return devicePixelRatioF();
-#elif QT_VERSION >= 0x050000
- return devicePixelRatio();
-#else
- return 1;
-#endif
}
@@ -369,11 +358,7 @@ void MapWindow::keyPressEvent(QKeyEvent *ev)
void MapWindow::mousePressEvent(QMouseEvent *ev)
{
-#if QT_VERSION < 0x050000
- m_lastPos = ev->posF();
-#else
m_lastPos = ev->localPos();
-#endif
if (ev->type() == QEvent::MouseButtonPress) {
if (ev->buttons() == (Qt::LeftButton | Qt::RightButton)) {
@@ -394,11 +379,7 @@ void MapWindow::mousePressEvent(QMouseEvent *ev)
void MapWindow::mouseMoveEvent(QMouseEvent *ev)
{
-#if QT_VERSION < 0x050000
- QPointF delta = ev->posF() - m_lastPos;
-#else
QPointF delta = ev->localPos() - m_lastPos;
-#endif
if (!delta.isNull()) {
if (ev->buttons() == Qt::LeftButton && ev->modifiers() & Qt::ShiftModifier) {
@@ -406,19 +387,11 @@ void MapWindow::mouseMoveEvent(QMouseEvent *ev)
} else if (ev->buttons() == Qt::LeftButton) {
m_map->moveBy(delta);
} else if (ev->buttons() == Qt::RightButton) {
-#if QT_VERSION < 0x050000
- m_map->rotateBy(m_lastPos, ev->posF());
-#else
m_map->rotateBy(m_lastPos, ev->localPos());
-#endif
}
}
-#if QT_VERSION < 0x050000
- m_lastPos = ev->posF();
-#else
m_lastPos = ev->localPos();
-#endif
ev->accept();
}
@@ -464,8 +437,6 @@ void MapWindow::paintGL()
{
m_frameDraws++;
m_map->resize(size());
-#if QT_VERSION >= 0x050400
m_map->setFramebufferObject(defaultFramebufferObject(), size() * pixelRatio());
-#endif
m_map->render();
}
diff --git a/platform/qt/app/mapwindow.hpp b/platform/qt/app/mapwindow.hpp
index 6c05f03562..0671c42518 100644
--- a/platform/qt/app/mapwindow.hpp
+++ b/platform/qt/app/mapwindow.hpp
@@ -3,27 +3,16 @@
#include <QMapboxGL>
-#include <QtGlobal>
-
-// XXX http://stackoverflow.com/questions/24899558/how-to-check-qt-version-to-include-different-header#comment59591604_29887388
-#if QT_VERSION >= 0x050400
#include <QOpenGLWidget>
-#else
-#include <QGLWidget>
-#endif // QT_VERSION
-
#include <QPropertyAnimation>
#include <QScopedPointer>
+#include <QtGlobal>
class QKeyEvent;
class QMouseEvent;
class QWheelEvent;
-#if QT_VERSION >= 0x050400
class MapWindow : public QOpenGLWidget
-#else
-class MapWindow : public QGLWidget
-#endif // QT_VERSION
{
Q_OBJECT