1
0
Fork 0

Simplify Qt version checks by requiring 5.4

This commit is contained in:
James Turner 2017-09-22 18:37:53 +01:00
parent 3a8d3506d6
commit c47325183c
6 changed files with 3 additions and 29 deletions

View file

@ -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}")

View file

@ -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();

View file

@ -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();

View file

@ -5,10 +5,6 @@
#include <QNetworkReply>
#include <QDebug>
#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)));
}

View file

@ -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);
}

View file

@ -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 )