mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 04:11:06 -05:00
Fix item selection not updating correctly
* Remove could lead to the "add" dialog being opened * Rename could result in some entries not being renamed (due to FilterComboBox using a QComboBox with setEditable() set to true)
This commit is contained in:
@@ -285,22 +285,20 @@ VariableSelection::VariableSelection(QWidget *parent)
|
||||
|
||||
void VariableSelection::SetVariable(const std::string &variable)
|
||||
{
|
||||
const QSignalBlocker blocker(_selection);
|
||||
if (!!GetVariableByName(variable)) {
|
||||
_selection->setCurrentText(QString::fromStdString(variable));
|
||||
SetItem(variable);
|
||||
} else {
|
||||
_selection->setCurrentIndex(-1);
|
||||
SetItem("");
|
||||
}
|
||||
}
|
||||
|
||||
void VariableSelection::SetVariable(const std::weak_ptr<Variable> &variable_)
|
||||
{
|
||||
const QSignalBlocker blocker(_selection);
|
||||
auto var = variable_.lock();
|
||||
if (var) {
|
||||
SetVariable(var->Name());
|
||||
SetItem(var->Name());
|
||||
} else {
|
||||
_selection->setCurrentIndex(-1);
|
||||
SetItem("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user