From: James Turner Date: Thu, 26 Feb 2015 23:29:35 +0000 (+0000) Subject: Fix a couple more Qt version issues. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=548b899fb69ce24b9a7650171de235bcbf086881;p=flightgear.git Fix a couple more Qt version issues. - only set the clearButton on QLineEdit if we have 5.2 - use itemData/currentIndex to avoid currentData() --- diff --git a/src/GUI/Launcher.ui b/src/GUI/Launcher.ui index 07d5a0ea8..ab9af86ae 100644 --- a/src/GUI/Launcher.ui +++ b/src/GUI/Launcher.ui @@ -173,9 +173,6 @@ Search aircraft - - true - diff --git a/src/GUI/QtLauncher.cxx b/src/GUI/QtLauncher.cxx index 7bc30c8e2..10a57ecb5 100644 --- a/src/GUI/QtLauncher.cxx +++ b/src/GUI/QtLauncher.cxx @@ -675,6 +675,11 @@ QtLauncher::QtLauncher() : // don't require Qt 5.3 m_ui->commandLineArgs->setPlaceholderText("--option=value --prop:/sim/name=value"); #endif + +#if QT_VERSION >= 0x050200 + m_ui->aircraftFilter->setClearButtonEnabled(true); +#endif + for (int i=0; i<4; ++i) { m_ratingFilters[i] = 3; } @@ -933,7 +938,7 @@ void QtLauncher::onRun() } if (m_ui->runwayRadio->isChecked()) { - int index = m_ui->runwayCombo->currentData().toInt(); + int index = m_ui->runwayCombo->itemData(m_ui->runwayCombo->currentIndex()).toInt(); if ((index >= 0) && m_selectedAirport) { // explicit runway choice opt->addOption("runway", m_selectedAirport->getRunwayByIndex(index)->ident());