Simplify Qt version checks by requiring 5.4
This commit is contained in:
parent
3a8d3506d6
commit
c47325183c
6 changed files with 3 additions and 29 deletions
|
@ -310,8 +310,8 @@ endif (USE_DBUS)
|
||||||
##############################################################################
|
##############################################################################
|
||||||
## Qt5 setup setup
|
## Qt5 setup setup
|
||||||
if (ENABLE_QT)
|
if (ENABLE_QT)
|
||||||
message(STATUS "Qt launcher enabled, checking for Qt 5.3 / qmake")
|
message(STATUS "Qt launcher enabled, checking for Qt 5.4 / qmake")
|
||||||
find_package(Qt5 5.3 COMPONENTS Widgets Network Qml QuickWidgets)
|
find_package(Qt5 5.4 COMPONENTS Widgets Network Qml QuickWidgets)
|
||||||
if (Qt5Widgets_FOUND)
|
if (Qt5Widgets_FOUND)
|
||||||
message(STATUS "Will enable Qt launcher GUI")
|
message(STATUS "Will enable Qt launcher GUI")
|
||||||
message(STATUS " Qt5Widgets version: ${Qt5Widgets_VERSION_STRING}")
|
message(STATUS " Qt5Widgets version: ${Qt5Widgets_VERSION_STRING}")
|
||||||
|
|
|
@ -25,11 +25,8 @@ ExtraSettingsSection::ExtraSettingsSection(QWidget* pr) :
|
||||||
topLevelVBox->addWidget(prompt);
|
topLevelVBox->addWidget(prompt);
|
||||||
m_argsEdit = new QTextEdit(this);
|
m_argsEdit = new QTextEdit(this);
|
||||||
m_argsEdit->setAcceptRichText(false);
|
m_argsEdit->setAcceptRichText(false);
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050300
|
|
||||||
// don't require Qt 5.3
|
|
||||||
m_argsEdit->setPlaceholderText("--option=value --prop:/sim/name=value");
|
m_argsEdit->setPlaceholderText("--option=value --prop:/sim/name=value");
|
||||||
#endif
|
|
||||||
topLevelVBox->addWidget(m_argsEdit);
|
topLevelVBox->addWidget(m_argsEdit);
|
||||||
|
|
||||||
insertSettingsHeader();
|
insertSettingsHeader();
|
||||||
|
|
|
@ -99,10 +99,7 @@ LauncherMainWindow::LauncherMainWindow() :
|
||||||
connect(viewCommandLineAction, &QAction::triggered,
|
connect(viewCommandLineAction, &QAction::triggered,
|
||||||
this, &LauncherMainWindow::onViewCommandLine);
|
this, &LauncherMainWindow::onViewCommandLine);
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050200
|
|
||||||
m_ui->aircraftFilter->setClearButtonEnabled(true);
|
m_ui->aircraftFilter->setClearButtonEnabled(true);
|
||||||
#endif
|
|
||||||
|
|
||||||
m_serversModel = new MPServersModel(this);
|
m_serversModel = new MPServersModel(this);
|
||||||
m_serversModel->refresh();
|
m_serversModel->refresh();
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
|
|
||||||
#define qInfo qDebug
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const int BORDER_SIZE = 16;
|
const int BORDER_SIZE = 16;
|
||||||
|
|
||||||
PreviewWindow::PreviewWindow(QWidget *parent)
|
PreviewWindow::PreviewWindow(QWidget *parent)
|
||||||
|
@ -30,7 +26,6 @@ void PreviewWindow::setUrls(QVariantList urls)
|
||||||
Q_FOREACH (QVariant v, urls) {
|
Q_FOREACH (QVariant v, urls) {
|
||||||
QUrl url = v.toUrl();
|
QUrl url = v.toUrl();
|
||||||
QNetworkReply* reply = m_netAccess->get(QNetworkRequest(url));
|
QNetworkReply* reply = m_netAccess->get(QNetworkRequest(url));
|
||||||
qInfo() << "requesting:" << url;
|
|
||||||
connect(reply, &QNetworkReply::finished, this, &PreviewWindow::onDownloadFinished);
|
connect(reply, &QNetworkReply::finished, this, &PreviewWindow::onDownloadFinished);
|
||||||
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onDownloadError(QNetworkReply::NetworkError)));
|
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onDownloadError(QNetworkReply::NetworkError)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,11 +498,7 @@ void SettingsText::setValue(QString newVal)
|
||||||
|
|
||||||
QString SettingsText::placeholder() const
|
QString SettingsText::placeholder() const
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= 0x050300
|
|
||||||
return m_edit->placeholderText();
|
return m_edit->placeholderText();
|
||||||
#else
|
|
||||||
return QString();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SettingsText::validation() const
|
QString SettingsText::validation() const
|
||||||
|
@ -515,10 +511,7 @@ void SettingsText::setPlaceholder(QString hold)
|
||||||
if (placeholder() == hold)
|
if (placeholder() == hold)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050300
|
|
||||||
// don't require Qt 5.3
|
|
||||||
m_edit->setPlaceholderText(hold);
|
m_edit->setPlaceholderText(hold);
|
||||||
#endif
|
|
||||||
emit placeholderChanged(hold);
|
emit placeholderChanged(hold);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,18 +144,14 @@ GLWindow::GLWindow()
|
||||||
: QWindow()
|
: QWindow()
|
||||||
{
|
{
|
||||||
_devicePixelRatio = 1.0;
|
_devicePixelRatio = 1.0;
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
|
|
||||||
connect(this, &QWindow::screenChanged, this, &GLWindow::onScreenChanged);
|
connect(this, &QWindow::screenChanged, this, &GLWindow::onScreenChanged);
|
||||||
onScreenChanged();
|
onScreenChanged();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLWindow::onScreenChanged()
|
void GLWindow::onScreenChanged()
|
||||||
{
|
{
|
||||||
qWarning() << Q_FUNC_INFO << "screen changed";
|
qWarning() << Q_FUNC_INFO << "screen changed";
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
|
|
||||||
_devicePixelRatio = screen()->devicePixelRatio();
|
_devicePixelRatio = screen()->devicePixelRatio();
|
||||||
#endif
|
|
||||||
|
|
||||||
if (_isPrimaryWindow) {
|
if (_isPrimaryWindow) {
|
||||||
// allow PUI and Canvas to be scaled
|
// allow PUI and Canvas to be scaled
|
||||||
|
@ -461,9 +457,7 @@ QSurfaceFormat GraphicsWindowQt5::traits2qSurfaceFormat( const osg::GraphicsCont
|
||||||
format.setSwapBehavior( traits->doubleBuffer ?
|
format.setSwapBehavior( traits->doubleBuffer ?
|
||||||
QSurfaceFormat::DoubleBuffer :
|
QSurfaceFormat::DoubleBuffer :
|
||||||
QSurfaceFormat::DefaultSwapBehavior);
|
QSurfaceFormat::DefaultSwapBehavior);
|
||||||
#if QT_VERSION >= 0x050300
|
|
||||||
format.setSwapInterval( traits->vsync ? 1 : 0 );
|
format.setSwapInterval( traits->vsync ? 1 : 0 );
|
||||||
#endif
|
|
||||||
format.setStereo( traits->quadBufferStereo ? 1 : 0 );
|
format.setStereo( traits->quadBufferStereo ? 1 : 0 );
|
||||||
|
|
||||||
return format;
|
return format;
|
||||||
|
@ -481,9 +475,7 @@ void GraphicsWindowQt5::qSurfaceFormat2traits( const QSurfaceFormat& format, osg
|
||||||
|
|
||||||
traits->quadBufferStereo = format.stereo();
|
traits->quadBufferStereo = format.stereo();
|
||||||
traits->doubleBuffer = (format.swapBehavior() == QSurfaceFormat::DoubleBuffer);
|
traits->doubleBuffer = (format.swapBehavior() == QSurfaceFormat::DoubleBuffer);
|
||||||
#if QT_VERSION >= 0x050300
|
|
||||||
traits->vsync = format.swapInterval() >= 1;
|
traits->vsync = format.swapInterval() >= 1;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::GraphicsContext::Traits* GraphicsWindowQt5::createTraits( const QWindow* window )
|
osg::GraphicsContext::Traits* GraphicsWindowQt5::createTraits( const QWindow* window )
|
||||||
|
|
Loading…
Add table
Reference in a new issue