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:
nerix
2023-12-16 12:24:28 +01:00
committed by GitHub
parent 434487750f
commit 66f4480371
27 changed files with 75 additions and 130 deletions
+16 -12
View File
@@ -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;