Skip to content

Commit

Permalink
Make it possible to set value in display unit (#8078)
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Nov 2, 2021
1 parent da82258 commit d0b18e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OMEdit/OMEditLIB/Element/ElementProperties.cpp
Expand Up @@ -412,6 +412,10 @@ void Parameter::createValueWidget()
*/
void Parameter::enableDisableUnitComboBox(const QString &value)
{
// Do not do anything when the value is empty.
if (value.isEmpty()) {
return;
}
/* Enable/disable the unit combobox based on the literalConstant
* Set the display unit as current when value is literalConstant otherwise use unit
* ticket:5618 Disable the unit drop down when we have a symbolic parameter
Expand All @@ -423,7 +427,7 @@ void Parameter::enableDisableUnitComboBox(const QString &value)
*/
if (!literalConstant) {
bool state = mpUnitComboBox->blockSignals(true);
int index = mpUnitComboBox->findData(literalConstant ? mDisplayUnit : mUnit);
int index = mpUnitComboBox->findData(mUnit);
if (index > -1 && index != mpUnitComboBox->currentIndex()) {
mpUnitComboBox->setCurrentIndex(index);
mPreviousUnit = mpUnitComboBox->itemData(mpUnitComboBox->currentIndex()).toString();
Expand Down

0 comments on commit d0b18e7

Please sign in to comment.