Skip to content

Conversation

@michaelgregorius
Copy link
Contributor

Remove the unused method Knob::setHtmlLabel and its associated members. This removes some unnecessary complexity from the code.

Remove the unused method `Knob::setHtmlLabel` and its associated members.
This removes some unnecessary complexity from the code.
@messmerd
Copy link
Member

messmerd commented Jul 7, 2025

Could you also move Knob::setLabel back to the public section and fix KnobControl::setText?

And if you want, you could make KnobControl default constructible again by adding a default argument to the constructor:

-KnobControl(const QString& text, QWidget* parent = nullptr);
+KnobControl(const QString& text = QString{}, QWidget* parent = nullptr);

Better to do it all together than create another PR for that, I think

Make `Knob::setLabel` public. Add `Knob::getLabel` for completeness.
Make `KnobControl::setText` delegate to the `Knob` instance now that `Knob::setLabel` is public again.
@michaelgregorius
Copy link
Contributor Author

Could you also move Knob::setLabel back to the public section

Done with commit 3377bdb.

and fix KnobControl::setText?

Done with commit 82d7773.

And if you want, you could make KnobControl default constructible again by adding a default argument to the constructor:

I decided against doing so because it seems that a default constructed KnobControl would not make much sense in the context of its current usages. It would be a knob without a label that has its own window. All instances are currently only used as children of other widgets. So in most cases the parent would have to be provided explicitly anyway and due to the position in the constructor the text would have to be provided as well.

Copy link
Member

@messmerd messmerd left a comment

Choose a reason for hiding this comment

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

LGTM

@messmerd messmerd merged commit 4c3f819 into LMMS:master Jul 8, 2025
11 checks passed
@michaelgregorius michaelgregorius deleted the RemoveKnobSetHtmlLabel branch July 8, 2025 17:25
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.

2 participants