mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-27 16:54:15 +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;
|
bool ok;
|
||||||
int index = combo->currentData().toInt(&ok);
|
int index = combo->currentData().toInt(&ok);
|
||||||
|
|
||||||
return ok ? index : -1;
|
return ok ? index : combo->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigTaskWidget::setComboboxSelectedOption(QComboBox *combo, int optionValue)
|
void ConfigTaskWidget::setComboboxSelectedOption(QComboBox *combo, int optionValue)
|
||||||
@ -231,6 +231,8 @@ void ConfigTaskWidget::setComboboxSelectedOption(QComboBox *combo, int optionVal
|
|||||||
|
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
combo->setCurrentIndex(index);
|
combo->setCurrentIndex(index);
|
||||||
|
} else {
|
||||||
|
combo->setCurrentIndex(optionValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user