From 06e0924bfcc3146fc1dfa248d3f1072f69818625 Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 18 Jun 2020 13:23:26 +0100 Subject: [PATCH] Remove checks for older Qt versions --- src/GUI/AirportDiagram.cxx | 6 ------ src/GUI/LauncherController.cxx | 3 --- src/GUI/QQuickDrawable.cxx | 8 +------- src/GUI/QtLauncher.cxx | 8 ++------ src/GUI/ThumbnailImageItem.cxx | 4 ---- src/Viewer/GraphicsWindowQt5.cpp | 8 -------- src/Viewer/GraphicsWindowQt5.hxx | 3 --- 7 files changed, 3 insertions(+), 37 deletions(-) diff --git a/src/GUI/AirportDiagram.cxx b/src/GUI/AirportDiagram.cxx index b2250150b..c95392c91 100644 --- a/src/GUI/AirportDiagram.cxx +++ b/src/GUI/AirportDiagram.cxx @@ -116,13 +116,7 @@ AirportDiagram::AirportDiagram(QQuickItem* pr) : f.setBold(true); QFontMetricsF metrics(f); qreal xOffset = metrics.width("H") * 0.5; -#if QT_VERSION >= 0x050800 qreal yOffset = metrics.capHeight() * 0.5; -#else - // capHeight is not avaialble in 5.7 and lower, compute - // it using tightBoundingRect - qreal yOffset = -0.5 * metrics.tightBoundingRect("H").y(); -#endif m_helipadIconPath.addText(-xOffset, yOffset, f, "H"); } diff --git a/src/GUI/LauncherController.cxx b/src/GUI/LauncherController.cxx index d58841fb5..218fac9fa 100644 --- a/src/GUI/LauncherController.cxx +++ b/src/GUI/LauncherController.cxx @@ -280,9 +280,6 @@ void LauncherController::collectAircraftArgs() QString state = m_aircraftState; if ((m_aircraftState == "auto") && !m_selectedAircraftInfo->haveExplicitAutoState()) { state = selectAircraftStateAutomatically(); -#if QT_VERSION >= 0x050600 - qInfo() << "doing launcher auto state selection, picked:" + state; -#endif } if (!state.isEmpty()) { diff --git a/src/GUI/QQuickDrawable.cxx b/src/GUI/QQuickDrawable.cxx index 436a875ea..4ea21233d 100755 --- a/src/GUI/QQuickDrawable.cxx +++ b/src/GUI/QQuickDrawable.cxx @@ -226,13 +226,7 @@ public slots: void initRenderControl() { qtContext = flightgear::qtContextFromOSG(osgContext); - - #if QT_VERSION < 0x050600 - SG_LOG(SG_GUI, SG_ALERT, "Qt < 5.6 was used to build FlightGear, multi-threading of QtQuick is not safe"); - #else - renderControl->prepareThread(QThread::currentThread()); - #endif - + renderControl->prepareThread(QThread::currentThread()); QOpenGLContextPrivate::setCurrentContext(qtContext); QOpenGLContextPrivate::get(qtContext)->surface = foreignOSGWindow; renderControl->initialize(qtContext); diff --git a/src/GUI/QtLauncher.cxx b/src/GUI/QtLauncher.cxx index 4000ce7a5..d8a29a240 100644 --- a/src/GUI/QtLauncher.cxx +++ b/src/GUI/QtLauncher.cxx @@ -214,9 +214,7 @@ static void simgearMessageOutput(QtMsgType type, const QMessageLogContext &conte sgDebugPriority mappedPriority = SG_WARN; switch (type) { case QtDebugMsg: mappedPriority = SG_DEBUG; break; -#if QT_VERSION >= 0x050500 case QtInfoMsg: mappedPriority = SG_INFO; break; -#endif case QtWarningMsg: mappedPriority = SG_WARN; break; case QtCriticalMsg: mappedPriority = SG_ALERT; break; case QtFatalMsg: mappedPriority = SG_POPUP; break; @@ -272,18 +270,16 @@ void initApp(int& argc, char** argv, bool doInitQSettings) // leave things unset here, so users can use env var // QT_AUTO_SCREEN_SCALE_FACTOR=1 to enable it at runtime -//#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) // QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -//#endif + static_qApp.reset(new QApplication(s_argc, argv)); static_qApp->setOrganizationName("FlightGear"); static_qApp->setApplicationName("FlightGear"); static_qApp->setOrganizationDomain("flightgear.org"); -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) static_qApp->setDesktopFileName( QStringLiteral("org.flightgear.FlightGear.desktop")); -#endif + QTranslator* fallbackTranslator = new QTranslator(static_qApp.get()); if (!fallbackTranslator->load(QLatin1String(":/FlightGear_en_US.qm"))) { qWarning() << "Failed to load default (en) translations"; diff --git a/src/GUI/ThumbnailImageItem.cxx b/src/GUI/ThumbnailImageItem.cxx index b9c25c1ec..708ab58a8 100644 --- a/src/GUI/ThumbnailImageItem.cxx +++ b/src/GUI/ThumbnailImageItem.cxx @@ -83,11 +83,7 @@ QSGNode *ThumbnailImageItem::updatePaintNode(QSGNode* oldNode, QQuickItem::Updat textureNode = new QSGSimpleTextureNode; textureNode->setOwnsTexture(true); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) QSGTexture* tex = window()->createTextureFromImage(m_image, QQuickWindow::TextureIsOpaque); -#else - QSGTexture* tex = window()->createTextureFromImage(m_image); -#endif textureNode->setTexture(tex); textureNode->markDirty(QSGBasicGeometryNode::DirtyMaterial); m_imageDirty = false; diff --git a/src/Viewer/GraphicsWindowQt5.cpp b/src/Viewer/GraphicsWindowQt5.cpp index dbd56f067..9361476f8 100644 --- a/src/Viewer/GraphicsWindowQt5.cpp +++ b/src/Viewer/GraphicsWindowQt5.cpp @@ -185,14 +185,6 @@ GLWindow::~GLWindow() } } -#if QT_VERSION < 0x050500 -void GLWindow::requestUpdate() -{ - // mimic Qt 5.5's requestUpdate method - QTimer::singleShot(0, this, SLOT(processUpdateEvent())); -} -#endif - bool GLWindow::event( QEvent* event ) { if (event->type() == QEvent::WindowStateChange) { diff --git a/src/Viewer/GraphicsWindowQt5.hxx b/src/Viewer/GraphicsWindowQt5.hxx index fe7408d67..042b3dcac 100644 --- a/src/Viewer/GraphicsWindowQt5.hxx +++ b/src/Viewer/GraphicsWindowQt5.hxx @@ -72,9 +72,6 @@ public: virtual void mouseMoveEvent( QMouseEvent* event ); virtual void wheelEvent( QWheelEvent* event ); -#if QT_VERSION < 0x050500 - void requestUpdate(); -#endif signals: void beforeRendering(); void afterRendering();