1
0
Fork 0

Remove checks for older Qt versions

This commit is contained in:
James Turner 2020-06-18 13:23:26 +01:00
parent cc798bf21a
commit 06e0924bfc
7 changed files with 3 additions and 37 deletions

View file

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

View file

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

View file

@ -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
QOpenGLContextPrivate::setCurrentContext(qtContext);
QOpenGLContextPrivate::get(qtContext)->surface = foreignOSGWindow;
renderControl->initialize(qtContext);

View file

@ -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";

View file

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

View file

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

View file

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