From c47325183c0978ca0290ad01c013f405e740c146 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 22 Sep 2017 18:37:53 +0100 Subject: [PATCH] Simplify Qt version checks by requiring 5.4 --- CMakeLists.txt | 4 ++-- src/GUI/ExtraSettingsSection.cxx | 5 +---- src/GUI/LauncherMainWindow.cxx | 3 --- src/GUI/PreviewWindow.cxx | 5 ----- src/GUI/SettingsWidgets.cxx | 7 ------- src/Viewer/GraphicsWindowQt5.cpp | 8 -------- 6 files changed, 3 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00add3cc7..7da0eebd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,8 +310,8 @@ endif (USE_DBUS) ############################################################################## ## Qt5 setup setup if (ENABLE_QT) - message(STATUS "Qt launcher enabled, checking for Qt 5.3 / qmake") - find_package(Qt5 5.3 COMPONENTS Widgets Network Qml QuickWidgets) + message(STATUS "Qt launcher enabled, checking for Qt 5.4 / qmake") + find_package(Qt5 5.4 COMPONENTS Widgets Network Qml QuickWidgets) if (Qt5Widgets_FOUND) message(STATUS "Will enable Qt launcher GUI") message(STATUS " Qt5Widgets version: ${Qt5Widgets_VERSION_STRING}") diff --git a/src/GUI/ExtraSettingsSection.cxx b/src/GUI/ExtraSettingsSection.cxx index 619b48c82..f44c88fc1 100644 --- a/src/GUI/ExtraSettingsSection.cxx +++ b/src/GUI/ExtraSettingsSection.cxx @@ -25,11 +25,8 @@ ExtraSettingsSection::ExtraSettingsSection(QWidget* pr) : topLevelVBox->addWidget(prompt); m_argsEdit = new QTextEdit(this); m_argsEdit->setAcceptRichText(false); - -#if QT_VERSION >= 0x050300 - // don't require Qt 5.3 m_argsEdit->setPlaceholderText("--option=value --prop:/sim/name=value"); -#endif + topLevelVBox->addWidget(m_argsEdit); insertSettingsHeader(); diff --git a/src/GUI/LauncherMainWindow.cxx b/src/GUI/LauncherMainWindow.cxx index 32716457c..98d2b2fd1 100644 --- a/src/GUI/LauncherMainWindow.cxx +++ b/src/GUI/LauncherMainWindow.cxx @@ -99,10 +99,7 @@ LauncherMainWindow::LauncherMainWindow() : connect(viewCommandLineAction, &QAction::triggered, this, &LauncherMainWindow::onViewCommandLine); -#if QT_VERSION >= 0x050200 m_ui->aircraftFilter->setClearButtonEnabled(true); -#endif - m_serversModel = new MPServersModel(this); m_serversModel->refresh(); diff --git a/src/GUI/PreviewWindow.cxx b/src/GUI/PreviewWindow.cxx index b10cd1c42..21fefa86e 100644 --- a/src/GUI/PreviewWindow.cxx +++ b/src/GUI/PreviewWindow.cxx @@ -5,10 +5,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -#define qInfo qDebug -#endif - const int BORDER_SIZE = 16; PreviewWindow::PreviewWindow(QWidget *parent) @@ -30,7 +26,6 @@ void PreviewWindow::setUrls(QVariantList urls) Q_FOREACH (QVariant v, urls) { QUrl url = v.toUrl(); QNetworkReply* reply = m_netAccess->get(QNetworkRequest(url)); - qInfo() << "requesting:" << url; connect(reply, &QNetworkReply::finished, this, &PreviewWindow::onDownloadFinished); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onDownloadError(QNetworkReply::NetworkError))); } diff --git a/src/GUI/SettingsWidgets.cxx b/src/GUI/SettingsWidgets.cxx index c3a9e93c8..dfad38910 100644 --- a/src/GUI/SettingsWidgets.cxx +++ b/src/GUI/SettingsWidgets.cxx @@ -498,11 +498,7 @@ void SettingsText::setValue(QString newVal) QString SettingsText::placeholder() const { -#if QT_VERSION >= 0x050300 return m_edit->placeholderText(); -#else - return QString(); -#endif } QString SettingsText::validation() const @@ -515,10 +511,7 @@ void SettingsText::setPlaceholder(QString hold) if (placeholder() == hold) return; -#if QT_VERSION >= 0x050300 - // don't require Qt 5.3 m_edit->setPlaceholderText(hold); -#endif emit placeholderChanged(hold); } diff --git a/src/Viewer/GraphicsWindowQt5.cpp b/src/Viewer/GraphicsWindowQt5.cpp index cc630e0cf..5e5b05bde 100644 --- a/src/Viewer/GraphicsWindowQt5.cpp +++ b/src/Viewer/GraphicsWindowQt5.cpp @@ -144,18 +144,14 @@ GLWindow::GLWindow() : QWindow() { _devicePixelRatio = 1.0; -#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) connect(this, &QWindow::screenChanged, this, &GLWindow::onScreenChanged); onScreenChanged(); -#endif } void GLWindow::onScreenChanged() { qWarning() << Q_FUNC_INFO << "screen changed"; -#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) _devicePixelRatio = screen()->devicePixelRatio(); -#endif if (_isPrimaryWindow) { // allow PUI and Canvas to be scaled @@ -461,9 +457,7 @@ QSurfaceFormat GraphicsWindowQt5::traits2qSurfaceFormat( const osg::GraphicsCont format.setSwapBehavior( traits->doubleBuffer ? QSurfaceFormat::DoubleBuffer : QSurfaceFormat::DefaultSwapBehavior); -#if QT_VERSION >= 0x050300 format.setSwapInterval( traits->vsync ? 1 : 0 ); -#endif format.setStereo( traits->quadBufferStereo ? 1 : 0 ); return format; @@ -481,9 +475,7 @@ void GraphicsWindowQt5::qSurfaceFormat2traits( const QSurfaceFormat& format, osg traits->quadBufferStereo = format.stereo(); traits->doubleBuffer = (format.swapBehavior() == QSurfaceFormat::DoubleBuffer); -#if QT_VERSION >= 0x050300 traits->vsync = format.swapInterval() >= 1; -#endif } osg::GraphicsContext::Traits* GraphicsWindowQt5::createTraits( const QWindow* window )