mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-06-28 09:45:45 +02:00
[qt] fix crash when switching between builds that add new filters
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
9a7ca3aca4
commit
d2c8bf7f5e
1 changed files with 5 additions and 3 deletions
|
|
@ -160,6 +160,10 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
|
||||||
|
|
||||||
serializer = [this, enumeration]() {
|
serializer = [this, enumeration]() {
|
||||||
int current = combobox->currentIndex();
|
int current = combobox->currentIndex();
|
||||||
|
if (current > int(enumeration->size())) {
|
||||||
|
LOG_WARNING(Frontend, "Invalid enum {}", current);
|
||||||
|
current = 0;
|
||||||
|
}
|
||||||
return std::to_string(enumeration->at(current).first);
|
return std::to_string(enumeration->at(current).first);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -169,10 +173,8 @@ QWidget* Widget::CreateCombobox(std::function<std::string()>& serializer,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Settings::IsConfiguringGlobal()) {
|
if (!Settings::IsConfiguringGlobal()) {
|
||||||
combobox->connect(combobox, QOverload<int>::of(&QComboBox::activated),
|
combobox->connect(combobox, QOverload<int>::of(&QComboBox::activated), [touch]() { touch(); });
|
||||||
[touch]() { touch(); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return combobox;
|
return combobox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue