Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt5 Double range slider

There are many postings online about trying to make a double range sliderenter image description here

The most common answer I found is to use libqxt. However, going to the website it clearly states it is not maintained due to internal api changes with newer versions of Qt.

Does Qt5 provide any new functionality for this, or is there a longer lasting Qt implementation that provides this functionality without requiring large external libraries?

like image 981
user-2147482637 Avatar asked Aug 06 '14 08:08

user-2147482637


2 Answers

If Qt Quick is an option, Qt Quick Controls 2 has a RangeSlider (in three different styles). The module has tech preview status in Qt 5.6, but is a proper module in 5.7.

Here's the Default style RangeSlider:

RangeSlider GIF

like image 192
Mitch Avatar answered Nov 09 '22 22:11

Mitch


From what I have read there are only two ways to go about getting a double range slider.

Use Qt4

You can use Qt4 and download libqxt. Libqxt already has that feature implemented so it shouldn't be too hard if you know how to use Qt4.

Two sliders on top of one another

http://qt-project.org/doc/qt-4.8/widgets-codeeditor.html

^That doesn't explain how to use double sliders, but it may help you figure out ho to draw two sliders on top of each other.

You can also use that same technique to draw the colors in between the two values.

like image 3
crank123 Avatar answered Nov 09 '22 23:11

crank123