Skip to content

Commit

Permalink
Update comboboxbase.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
boutinb committed Dec 5, 2024
1 parent bfe343f commit 0ef7d2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions QMLComponents/controls/comboboxbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ void ComboBoxBase::bindTo(const Json::Value& value)
{
addControlError(tr("Unknown option %1 in DropDown %2").arg(tq(selectedValue)).arg(name()));
index = 0;
// Maybe the values will be reset afterwards due to some QML/JavaScript dependencies: use this selectedValue if the model is reset during the initialization of the form
_unusedInitialValue = selectedValue;
}
index = int(std::distance(values.begin(), itr));
}
Expand Down Expand Up @@ -193,6 +195,7 @@ void ComboBoxBase::termsChangedHandler()
itr = lostValueItr;
_orgValue = _unusedInitialValue;
_unusedInitialValue = "";
clearControlError();
}
}

Expand Down

0 comments on commit 0ef7d2e

Please sign in to comment.