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
5
votes
2 answers

How to make a tip to follow the handler of slider with PyQT?

A simple question, I am looking for a effect in pyqt like this: Jquery UI slider how to make a box follow the handler? But those code is JQuery and I am trying to achieve it with PyQT import sys from PyQt4 import QtGui, QtCore class…
BangZ
  • 53
  • 1
  • 4
3
votes
3 answers

How to add a tick mark to a slider if it cannot inherit QSlider

I have a Qt dialog and there is a slider in it, when the dialog is initialized the slider will be set a value. In order to remind the user what is the default value, I want to add a mark to the slider, just draw a line or a triangle above the…
Royt
  • 199
  • 4
  • 14
3
votes
0 answers

How do I get position of QSlider bar in Qt?

I'm using QSlider object in my Qt application and I want to get the position of the slider bar upon moving it. I tried using pos() function, but it always returns QPoint() with the same values of x and y (i suppose it returns position of top left…
George
  • 578
  • 4
  • 21
3
votes
1 answer

How to reverse a QSlider's range

i am stuck at trying to reverse the range of a QSlider such that abs(maxVal) always stays on top. slider->setRange[0,maxVal] should look like the slider on the right slider->setRange[-maxVal,0] should be reversed/rotated. What i could do is not…
jonnyx
  • 345
  • 2
  • 16
3
votes
1 answer

How to change QSlider handle width using stylesheet

I have an application that I wan't to run on a 10" touch screen. I am trying to make the QSlider handle larger so it will be easier to move. I have found plenty of examples of changing the handle width in the style sheet, but the changes are not…
Mike
  • 35
  • 1
  • 1
  • 7
3
votes
2 answers

PyQt5: QSlider valueChanged event with delay

I'm using QSlider in my GUI application in order to perform a heavy task after value changed in the QSlider. I'm doing that as follows. self.slider.valueChanged.connect(self.value_changed) # Inside __init__() function def value_changed(self): #…
Ramesh-X
  • 4,853
  • 6
  • 46
  • 67
3
votes
1 answer

How to put ticks at custom places on a Qslider?

Hi I tried to implement a custom QSlider, but the ticks are always in intervalls, and i need to put them at specific places. I have no idea on how to proceed.
user3420412
  • 31
  • 2
  • 3
3
votes
1 answer

qt qslider not smooth

I have a qslider to control the zooming of a map like this: connect(ui->zoomSlider, SIGNAL(valueChanged(int)), ui->map, SLOT(SetZoom(int))); However, because this online-map response relatively slow. I found that the qslider's response also becomes…
Nyaruko
  • 4,329
  • 9
  • 54
  • 105
3
votes
2 answers

adding multiple qslider and qspinner

I add QSlider and QSpinBox with this code QSpinBox *spinner2 = new QSpinBox; QSlider *slider2 = new QSlider(Qt::Vertical); spinner2->setRange(2,100); slider2->setRange(2,100); QObject::connect(spinner2, SIGNAL(valueChanged(int)), slider2,…
sven
  • 1,101
  • 7
  • 21
  • 44
3
votes
2 answers

How to draw a picture instead of the slider on Qt QSlider?

I have created a class that inherits from QSlider. I want to draw a picture on the slider (grabber) instead of showing the plain one. How to do it? -- I found an answer and posted after I had received the reply. With due respect to the responder, I…
Viet
  • 17,944
  • 33
  • 103
  • 135
3
votes
1 answer

Make QSliders ignore mouse wheel/scrolling

I have a QScrollArea with a set of custom sliders arranged on it. I have noticed that when trying to scroll through the scroll area, one of the sliders often ends up moving instead, which is not desirable. To make the custom sliders ignore the…
norman
  • 5,128
  • 13
  • 44
  • 75
3
votes
2 answers

QSlider and Key Press Event

I currently have a QSlider that scrolls through frames of image data using the mouse. I would like to be able to use the arrow keys to scroll through a single step (one frame). This is my current sliderMoved code: def sliderMoved(self,val): …
Victoria Price
  • 637
  • 3
  • 13
  • 26
3
votes
4 answers

qslider sliderReleased value

I m trying to make a media player . The time status of the track is shown using QSlider. Track seek should happen when the user releases the slider somewhere on the QSlider. I had a look on the list of QSlider signals. The one that seems to fit is…
Vihaan Verma
  • 12,815
  • 19
  • 97
  • 126
2
votes
1 answer

Rotations with QQuaternion and QSlider

I have implemented an Objectrotation with QQuaternion and QPushButton. As long as the plus_x_button is pushed the slot rotate_plus_x() is activated. Respectively for minus_x. void OpenGLScene::rotate_plus_x() { OpenGLScene::anglex = 2; …
buddy
  • 821
  • 2
  • 12
  • 30
2
votes
1 answer

PyQt5: How to detect if QSlider is dragged to the end

I want to detect if a user drags a QSlider handle all the way to the end. I created a video player that displays the video frames in a QLabel object. A horizontal QSlider object tracks the video position and can also be dragged to position the…
slalomchip
  • 779
  • 2
  • 9
  • 25
1
2
3
9 10