1
0
Fork 0

Fix a couple more Qt version issues.

- only set the clearButton on QLineEdit if we have 5.2
- use itemData/currentIndex to avoid currentData()
This commit is contained in:
James Turner 2015-02-26 23:29:35 +00:00
parent 146efcafa4
commit 548b899fb6
2 changed files with 6 additions and 4 deletions

View file

@ -173,9 +173,6 @@
<property name="placeholderText">
<string>Search aircraft</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>

View file

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