From 3d5fae21724ccd7c3ce6ea8040b4fad26bbcee31 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sat, 6 Jun 2015 11:23:01 +0200 Subject: [PATCH] REVONANO: Fix for Comboboxes not having options but rather just an integer value that equals the actual selected index.. --- .../src/plugins/uavobjectwidgetutils/configtaskwidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index ed1c22b8d..1ba588a85 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -222,7 +222,7 @@ int ConfigTaskWidget::getComboboxSelectedOption(QComboBox *combo) bool ok; int index = combo->currentData().toInt(&ok); - return ok ? index : -1; + return ok ? index : combo->currentIndex(); } void ConfigTaskWidget::setComboboxSelectedOption(QComboBox *combo, int optionValue) @@ -231,6 +231,8 @@ void ConfigTaskWidget::setComboboxSelectedOption(QComboBox *combo, int optionVal if (index != -1) { combo->setCurrentIndex(index); + } else { + combo->setCurrentIndex(optionValue); } }