refactor: fix clang-tidy auto*, const&, and curly braces (#5083)

This commit is contained in:
pajlada
2024-01-14 17:54:52 +01:00
committed by GitHub
parent 292f9b9734
commit 5b6675abb4
78 changed files with 647 additions and 228 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ BaseWidget::BaseWidget(QWidget *parent, Qt::WindowFlags f)
}
void BaseWidget::clearShortcuts()
{
for (auto shortcut : this->shortcuts_)
for (auto *shortcut : this->shortcuts_)
{
shortcut->setKey(QKeySequence());
shortcut->removeEventFilter(this);
@@ -122,7 +122,7 @@ void BaseWidget::setScaleIndependantHeight(int value)
float BaseWidget::qtFontScale() const
{
if (auto window = dynamic_cast<BaseWindow *>(this->window()))
if (auto *window = dynamic_cast<BaseWindow *>(this->window()))
{
// ensure no div by 0
return this->scale() / std::max<float>(0.01f, window->nativeScale_);
@@ -138,7 +138,7 @@ void BaseWidget::childEvent(QChildEvent *event)
if (event->added())
{
// add element if it's a basewidget
if (auto widget = dynamic_cast<BaseWidget *>(event->child()))
if (auto *widget = dynamic_cast<BaseWidget *>(event->child()))
{
this->widgets_.push_back(widget);
}