1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

REVONANO: Fix for Comboboxes not having options but rather just an integer value that equals the actual selected index..

This commit is contained in:
m_thread 2015-06-06 11:23:01 +02:00
parent 631c1b2361
commit 3d5fae2172

View File

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