Skip to content

Consider adding QSpinBox API to QLabeledSlider #291

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

Open
gselzer opened this issue Apr 18, 2025 · 4 comments
Open

Consider adding QSpinBox API to QLabeledSlider #291

gselzer opened this issue Apr 18, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@gselzer
Copy link
Contributor

gselzer commented Apr 18, 2025

Consider a slider wrapping a percentage value. If you want to add % as a suffix on the label, you have to access the private _label field.

Of course, for something like a QLabeledDoubleRangeSlider, there are 4 different labels that then have to be edited.

I think it'd be great if the QLabeledSlider had the API for this.

Happy to file a PR if people like the idea.

@gselzer gselzer added the enhancement New feature or request label Apr 18, 2025
@tlambert03
Copy link
Member

Definitely 👍

Rather than passing through all the methods though, maybe we follow the same thing that complex qt widgets do (like QComboBox.lineedit https://doc.qt.io/qt-6/qcombobox.html#lineEdit) and add a method that returns the full widget like .spinBox() and/or .label()?

Not sure if setters would be appropriate, but maybe those too

@gselzer
Copy link
Contributor Author

gselzer commented Apr 18, 2025

Rather than passing through all the methods though, maybe we follow the same thing that complex qt widgets do (like QComboBox.lineedit https://doc.qt.io/qt-6/qcombobox.html#lineEdit) and add a method that returns the full widget like .spinBox() and/or .label()?

Yeah, that was my first thought, but like I mentioned with QLabeledDoubleRangeSlider, there are then two labels (and arguably we'd also want e.g. the suffix on the handles, too) - I think the extensibility required warrants passthrough...

Image

@tlambert03
Copy link
Member

Ahh I see. Ok so the pass through would update all of them?

@tlambert03
Copy link
Member

In any case, I’m supportive of the general goal of making that publicly accessible and open to whatever PR you come up with!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants