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:
parent
631c1b2361
commit
3d5fae2172
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user