]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a couple more Qt version issues.
authorJames Turner <zakalawe@mac.com>
Thu, 26 Feb 2015 23:29:35 +0000 (23:29 +0000)
committerJames Turner <zakalawe@mac.com>
Fri, 27 Feb 2015 11:58:22 +0000 (11:58 +0000)
- only set the clearButton on QLineEdit if we have 5.2
- use itemData/currentIndex to avoid currentData()

src/GUI/Launcher.ui
src/GUI/QtLauncher.cxx

index 07d5a0ea8c2c7e0be0cc7dc530f5b3df6ba1912b..ab9af86ae5f1ec8c506e8b491ed7955488f2d3b8 100644 (file)
            <property name="placeholderText">
             <string>Search aircraft</string>
            </property>
-           <property name="clearButtonEnabled">
-            <bool>true</bool>
-           </property>
           </widget>
          </item>
          <item>
index 7bc30c8e212925b0059f128a6cef731b88550b51..10a57ecb5d97de55c9669f0f729b3f63aabce208 100644 (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());