Questions tagged [qslider]

QSlider is a Qt class that represents a vertical or horizontal slider.

A slider lets a user move a handle along a horizontal or vertical line, and then translates the handle position into a value within a range.

To use QSlider, a number of options must be set, including:

  • minimum value through setMinimum()
  • maximum value through setMaximum()
  • step value through setSingleStep()

A minimalistic example of a QSlider looks like this:

QSlider *s = new QSlider();
s->setMaximum(100);
s->setMinimum(0);
s->setSingleStep(1);
s->show();

Official documentation can be found here.

147 questions
1
vote
1 answer

QSlider event on changing minimum, maximum or range

Is there any way to catch event when QSlider minimum, maximum or range is changed? Like if setMaximum(), setMinimum() and setRange() were Qt signals.
user707779
1
vote
2 answers

Python PyQt4 QSlider Interval bigger than 1

I am making a gui with multiple QSlider in a scrollarea, for some of my sliders i need an interval of 10 and not 1. When i open the gui the ticks are correct and have a jump of 10, but when i return the current value i can still get values that are…
Drza loren
  • 103
  • 1
  • 3
  • 10
1
vote
1 answer

How do I determine what direction a QSlider is being moved?

Is there a way to get the direction that a QSlider in Qt 5.9 is moving? For context, I am making a GUI in which the user can adjust some sliders, under the condition that the total sum is below 1. The sliders are above each other, and if you move…
cLupus
  • 535
  • 6
  • 16
1
vote
0 answers

Disable part of a QSlider

I am looking for a way to disable a part of a QSlider, and I mean disable it such that when you drag it it doesn't allow you to go passed a certain value. I know this effect is usually enforced with setMinumum() and setMaximum(), but for UI reasons…
Dan
  • 1,466
  • 1
  • 13
  • 27
1
vote
1 answer

Get emitted signal from custom method. connect qSlider with qDoubleSpinBox

I would like to connect a QDoubleSpinBox with a horizontal QSlider. I have found enough examples to know that they require different argument types ( double vs. int). I have found I can connect them using the new QT5…
joacampb
  • 177
  • 1
  • 18
1
vote
2 answers

Can we connect QPushButton to change values of QSlider?

I have two push buttons labeled with + and - probably, I need to increase and decrease the values of the slider using these push buttons, Please help me to code this function.
Yana
  • 87
  • 1
  • 1
  • 11
1
vote
1 answer

Changing the value of a dial slide with an input in QT?

Well, I am kind of stuck on this issue - I am trying to change the value of a dial slider and I want to change it using an input with QLineEdit input field and so far I couldn't find anything that could have helped me on the internet. Code snip void…
Joe Carr
  • 445
  • 1
  • 10
  • 23
1
vote
1 answer

creating MAC like QSlider

I want to make the default QSlider like that of Macintosh. Is it possible. I tried with the setStyleSheet, but failed to make that one. Any suggestions... Please?
user435062
  • 123
  • 2
  • 4
  • 9
1
vote
2 answers

How to adjust a QSlider's handle?

I'm writing an app for a touchscreen, and the default handle is too small to grab reliably, so I want to make it bigger. According to the official documentation, several answers on SE, and a couple of other forums, this ought to work in a QWidget's…
AaronD
  • 503
  • 1
  • 7
  • 23
1
vote
0 answers

QSlider with a custom stylesheet to make pressed handle bigger

i want to make a material like slider. The slider handle should get bigger when pressed, but when I click on it, it makes this: top: not clicked, bottom: klicked And after I move the handle its getting bigger. I'm using a…
semic
  • 29
  • 2
1
vote
2 answers

Place QSlider next to a QToolButton

I have a Widgets with LineEdit 's to set some int values. To make that easier, I have an additional QToolButton which shall show a QSlider to modifiy that value. IMPORTANT: The Slider is intially hidden! It shall only appear if the Button was…
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
1
vote
0 answers

How to get the length of the left/right offsets in a QSlider?

I'm trying to make a subclass of QSlider that allows the user to insert "bookmarks" so they can remember significant locations on the slider. I've run into a problem painting the tabs on the slider - using QStyle.sliderPositionFromValue, I get a…
The Bearded Templar
  • 671
  • 1
  • 7
  • 16
1
vote
1 answer

Connect Qslider and MatplotlibWidget

I am a real beginner in python and try to connect a qslider to a matplotlibwidget. That means if I change the value of the slider the graph should change. It seems that the value changes correctly, while the graph stays the same. Can anyone tell me…
user3271581
  • 11
  • 1
  • 3
1
vote
1 answer

PySide/PyQt, is is possible to make sliders dependent i.e. give them a combined maximum

In pyside or pyqt: Say that I have 3 sliders whose combined value mustn't exceed 9 or/and that it would always have to be 9. Is there an inbuilt way to make them depended in such a way, or do I have to program them. Illustration: 0123456789 1…
UrbKr
  • 621
  • 2
  • 11
  • 27
1
vote
1 answer

QSlider focus issue (Mac Leopard) with QApplication::focusChanged(QWidget*,QWidget*)

I'm using Qt 4.6.0 in Leopard 10.5.8. I have a few sliders. Every time I slide/click on a slider, it gets focus in Windows. However, it does not get focus on Mac. I have to manually click Tab to change focus. How to rectify this? Thanks in advance!
Viet
  • 17,944
  • 33
  • 103
  • 135