Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: experiment with a new setting widget builder #5585

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pajlada
Copy link
Member

@pajlada pajlada commented Sep 8, 2024

This will create more widgets per setting, but the goal is to more simply allow us to add various free text to settings that need them.

I don't plan on migrating all settings, but I migrated all the enum dropdowns so I removed that implementation.

It's not really a builder pattern but it tries to be similar to it

bit more like a builder pattern for adding settings to settings pages

i have migrated a few settings, but don't want to do all of them
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -44,9 +45,16 @@ GeneralPageView::GeneralPageView(QWidget *parent)
});
}

void GeneralPageView::addWidget(QWidget *widget)
void GeneralPageView::addWidget(QWidget *widget, QStringList keywords)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: the parameter 'keywords' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]

src/widgets/settingspages/GeneralPageView.hpp:98:

-     void addWidget(QWidget *widget, QStringList keywords = {});
+     void addWidget(QWidget *widget, const QStringList& keywords = {});
Suggested change
void GeneralPageView::addWidget(QWidget *widget, QStringList keywords)
void GeneralPageView::addWidget(QWidget *widget, const QStringList& keywords)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant