diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp index c224d8ece..28a3f1df4 100644 --- a/platform/qt/app/mapwindow.cpp +++ b/platform/qt/app/mapwindow.cpp @@ -38,9 +38,9 @@ void MapWindow::selfTest() } qreal MapWindow::pixelRatio() { -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) +#if QT_VERSION >= 0x050600 return devicePixelRatioF(); -#elif (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) +#elif QT_VERSION >= 0x050000 return devicePixelRatio(); #else return 1; diff --git a/platform/qt/app/mapwindow.hpp b/platform/qt/app/mapwindow.hpp index 2ce93419f..23880902d 100644 --- a/platform/qt/app/mapwindow.hpp +++ b/platform/qt/app/mapwindow.hpp @@ -1,15 +1,29 @@ #ifndef MAPWINDOW_H #define MAPWINDOW_H -#include #include + +#include + +// XXX http://stackoverflow.com/questions/24899558/how-to-check-qt-version-to-include-different-header#comment59591604_29887388 +#if QT_VERSION >= 0x050400 +#include +#else +#include +#endif // QT_VERSION + #include +#include class QKeyEvent; class QMouseEvent; class QWheelEvent; +#if QT_VERSION >= 0x050400 +class MapWindow : public QOpenGLWidget +#else class MapWindow : public QGLWidget +#endif // QT_VERSION { Q_OBJECT diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index e1a8a463e..dfd6ff58d 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #else #include #endif