Fix MSVC compiler warning

reg. declaration of 'role' hides function parameter (C4457)
This commit is contained in:
Joachim Schmitz 2023-10-05 16:13:13 +02:00 committed by Igor Korsukov
parent f05674be79
commit 616a2c96e8

View file

@ -63,11 +63,11 @@ QList<int> ButtonBoxModel::load()
const std::vector<ButtonRole>& currentLayout = chooseButtonLayoutType();
auto buttonsByRole = [&sortedButtons, maxCustomRole](ButtonRole role) -> std::vector<LayoutButton*> {
bool isCustom = role == ButtonRole::CustomRole;
auto buttonsByRole = [&sortedButtons, maxCustomRole](ButtonRole buttonRole) -> std::vector<LayoutButton*> {
bool isCustom = buttonRole == ButtonRole::CustomRole;
if (!isCustom) {
if (contains(sortedButtons, static_cast<int>(role))) {
return sortedButtons[role];
if (contains(sortedButtons, static_cast<int>(buttonRole))) {
return sortedButtons[buttonRole];
}
return {};