fix: Fixed some compiler warnings (#5028)
* fix(C4101): unreferenced local variable * fix(C4189): variable initialized but not referenced * fix(C4305): narrowing from double to float * fix(C4457): declaration hiding function parameter * fix(C4456): shadowing declaration * fix(C4996): remove deprecations * chore: add changelog entry * fix: Remove more unused variables * fix: removed unused lambda captures * Update changelog entry --------- Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -256,9 +256,9 @@ public:
|
||||
{
|
||||
auto *combo = this->addDropdown(text, {}, std::move(toolTipText));
|
||||
|
||||
for (const auto &text : items)
|
||||
for (const auto &item : items)
|
||||
{
|
||||
combo->addItem(QString::fromStdString(std::string(text)));
|
||||
combo->addItem(QString::fromStdString(std::string(item)));
|
||||
}
|
||||
|
||||
if (!defaultValueText.isEmpty())
|
||||
|
||||
@@ -34,8 +34,7 @@ void tableCellClicked(const QModelIndex &clicked, EditableModelView *view,
|
||||
if (wasAccepted)
|
||||
{
|
||||
auto newHotkey = dialog.data();
|
||||
auto vectorIndex =
|
||||
getApp()->hotkeys->replaceHotkey(hotkey->name(), newHotkey);
|
||||
getApp()->hotkeys->replaceHotkey(hotkey->name(), newHotkey);
|
||||
getApp()->hotkeys->save();
|
||||
}
|
||||
}
|
||||
@@ -69,7 +68,7 @@ KeyboardSettingsPage::KeyboardSettingsPage()
|
||||
if (wasAccepted)
|
||||
{
|
||||
auto newHotkey = dialog.data();
|
||||
int vectorIndex = getApp()->hotkeys->hotkeys_.append(newHotkey);
|
||||
getApp()->hotkeys->hotkeys_.append(newHotkey);
|
||||
getApp()->hotkeys->save();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -21,36 +21,40 @@ bool filterItemsRec(QObject *object, const QString &query)
|
||||
widget->update();
|
||||
};
|
||||
|
||||
if (auto x = dynamic_cast<SCheckBox *>(child); x)
|
||||
if (auto *checkBox = dynamic_cast<SCheckBox *>(child))
|
||||
{
|
||||
setOpacity(x, x->text().contains(query, Qt::CaseInsensitive));
|
||||
setOpacity(checkBox,
|
||||
checkBox->text().contains(query, Qt::CaseInsensitive));
|
||||
}
|
||||
else if (auto x = dynamic_cast<SLabel *>(child); x)
|
||||
else if (auto *lbl = dynamic_cast<SLabel *>(child))
|
||||
{
|
||||
setOpacity(x, x->text().contains(query, Qt::CaseInsensitive));
|
||||
setOpacity(lbl, lbl->text().contains(query, Qt::CaseInsensitive));
|
||||
}
|
||||
else if (auto x = dynamic_cast<SComboBox *>(child); x)
|
||||
else if (auto *comboBox = dynamic_cast<SComboBox *>(child))
|
||||
{
|
||||
setOpacity(x, [=]() {
|
||||
for (int i = 0; i < x->count(); i++)
|
||||
setOpacity(comboBox, [=]() {
|
||||
for (int i = 0; i < comboBox->count(); i++)
|
||||
{
|
||||
if (x->itemText(i).contains(query, Qt::CaseInsensitive))
|
||||
if (comboBox->itemText(i).contains(query,
|
||||
Qt::CaseInsensitive))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}());
|
||||
}
|
||||
else if (auto x = dynamic_cast<QTabWidget *>(child); x)
|
||||
else if (auto *tabs = dynamic_cast<QTabWidget *>(child))
|
||||
{
|
||||
for (int i = 0; i < x->count(); i++)
|
||||
for (int i = 0; i < tabs->count(); i++)
|
||||
{
|
||||
bool tabAny{};
|
||||
|
||||
if (x->tabText(i).contains(query, Qt::CaseInsensitive))
|
||||
if (tabs->tabText(i).contains(query, Qt::CaseInsensitive))
|
||||
{
|
||||
tabAny = true;
|
||||
}
|
||||
auto widget = x->widget(i);
|
||||
auto *widget = tabs->widget(i);
|
||||
tabAny |= filterItemsRec(widget, query);
|
||||
|
||||
any |= tabAny;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
{ \
|
||||
QPainter painter(this); \
|
||||
QColor color = QColor("#222222"); \
|
||||
color.setAlphaF(0.7); \
|
||||
color.setAlphaF(0.7F); \
|
||||
painter.fillRect(this->rect(), color); \
|
||||
} \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user