Unsolved Looking for a widget for selecting minimum and maximum in an interval
-
Is there any widget that looks something like this :
I need such a widget that has :
- Assignable minimum and maximum
- Two movable handles for enlarging the minimum / reducing the maximum
- The currently selected values are displayed near the handles
-
@Harry123 hi,
in QML theres the RangeSlider, for QWidgets we don't have a predefined RangeSlider widget. You'll have to create your own.Alternatively.
Googling for QRangeSlider gave this result:
https://github.com/rsgalloway/QRangeSliderGoogling for QSelectionSlider gave exactly one result:
This persons git-pagemight be usefull.
-
Thanks for your answer, but one is in Python while I use C++, and QSelectionSlider is not it and looks like this:
-
@Harry123 said in Looking for a widget for selecting minimum and maximum in an interval:
but one is in Python while I use C++
but it uses Qt right?
-
It does - but there are hundreds of lines in a language that I don't know ...
-
@Harry123
Well im not sure it will have 2 handles anyway
at least not like u show.but its styleable so may it could but i doubt it.
from samples it looks like
Anyway, there is also
https://libqxt.bitbucket.io/doc/tip/qxtspanslider.html#details
-
Libqxt seems to require more than just the bare files of the class QxtSpanSlider. I downloaded the source, and it contains references to various internal functions of the library. I really hesitate to use such a large body of code, containing many references to various internal functions of the library, as I would probably end up by incorporating the entire library.
Has nobody ever come up with something simple and self-contained ?
-
@Harry123
Yep Libqxt is a collection of widgets and they do reuse from the base.I have not seen anything like the one you have shown. There has been questions about making a dual slider
if you use the search function but none provide a complete solution.There are samples around you could adapt.
this one might be useful
https://stackoverflow.com/questions/17361885/range-slider-in-qt-two-handles-in-a-qsliderBut as with all samples, it will need some work to be complete.
-
Thanks, but I have seen this answer and it's too much work just to beautify somewhat the UI.
I have for the moment I replaced this widget by from-to text fields which work just as well, although not as beautiful.
A great pity that such a widget is not provided as standard, but that's life. -
@Harry123
Yeah, sadly more focus on QML than extending the range of standard widgets included.
Also, for one widget, its a lot of work to make sure it works correctly across all
platforms supported.
However, the class SuperSlider linked to works fairly well so would not been that much extra work
but i agree its maybe be overkill of you need use it only once.