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

QSlider Handle Size PyQt5

I'm trying to increase the width of the Qslider handle to make it more user friendly on small screens, but I've only found ways of doing this in C++. I have tried to implement this in python using the following code, only for it to change the colour…
Jkind9
  • 742
  • 7
  • 24
2
votes
0 answers

Connecting QSlider and QDoubleSpinBox gets stuck on certain values

I'm using mostly double spin boxes in my application and I'm connecting each one to a slider to sync up their values. The method I'm using works perfectly except when the spin box value reaches 0.28, 0.56, and 1.12. When using my scroll wheel to…
2
votes
3 answers

Difficulty Manipulating QSlider in a QGridLayout

I'm trying to create a dynamic QSlider that accepts a QVector of integer values and maps them underneath the QSlider relative to what position they represent. Here's a screenshot of what I have now: My Slider…
kwikness
  • 1,425
  • 4
  • 21
  • 37
2
votes
1 answer

How to customize the groove of QSlider

Is there any way to customize the groove of QSlider? I want to colorize some part of groove based on some value. I try setStyleSheet() but it's not working as I have expected. My similar question was asked before here. Like this: Based on a range…
Kate
  • 43
  • 5
2
votes
0 answers

How to prevent focusing of QSlider when touch scrolling with QScroller?

I have a QScrollArea with QScroller::grabGesture(wgt, QScroller::LeftMouseButtonGesture);. Inside it, I have multiple widgets. I'm trying to make it work in such a way so that people can scroll using touch gestures without worrying about…
Danol
  • 368
  • 1
  • 15
2
votes
1 answer

Disable specific keyboard event of qslider

I am using qslider in python 3. I can move cursor forward and backward by keyboard event of up, down, left and right arrow. I would like to disable specifically part of them: up and down arrow move cursor while right and left cursor do not. Is it…
2
votes
2 answers

PYQT5: Using a for loop or something else to create many QSliders of the same type

I'm using PYQT5 to create a GUI to display sliders, and I want an efficient way to create many sliders of the same type but with different names. Currently, I have to copy paste the same code to make each individual slider, so my code is…
user_13439903
  • 91
  • 1
  • 8
2
votes
2 answers

How to get size of QSlider-handle?

QSliders are displayed differently on different platforms. How can I get the width and height of the handle of a QSlider, being it styled using CSS or not? I am only aware of methods to retrieve the size of the whole QWidget, but not the handle?
t0bias
  • 93
  • 3
  • 13
2
votes
1 answer

How do I change color of the handle on QSlider

I am unsuccessfully trying to change the color of the handle on a QSlider. How do I change it to a custom color? I have subclassed QSlider so that I can reimplement the paint event and draw my own rectangle on it--now I want to set the color of…
jhowland
  • 365
  • 1
  • 5
  • 19
2
votes
1 answer

Add a slide in Qt that moves a signal up and down the y axis

I have three real time signals on the same graph, but sometimes they overlap and I need a slide button to move them up and down the y axis to see them better. How can I connect the slide to the graph? Like when the value of the slide changes, the…
Ana
  • 45
  • 4
2
votes
1 answer

QT Designer: Connect QSlider and QDoubleSpinBox (both ways)

I'm new to QT Designer and am building interfaces for Maya. In most tutorials I've seen, setting signals/slots between two objects is pretty straightforward. I'm trying to setup a slider and spinbox to drive each other. If the slider is updated, the…
john
  • 408
  • 9
  • 30
2
votes
4 answers

How to make a QSlider read-only?

Using Qt 5.2.1 Is it possible to set a QSlider (doesn't matter if it's horizontal or vertical) to read-only that is user cannot change the value of the slider but only use it as an indicator of some sort? I was unable to find anything in the Qt…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
2
votes
2 answers

QSlider , QTimer and valueChanged usage

I try to use QSlider, QTimer and valueChanged() signal together but I need to differentiate whether value of slider is changed by user or timer tick. How can I accomplish this? By below code I try to decide when slider is changed by timer but I…
Palindrom
  • 451
  • 9
  • 26
2
votes
1 answer

Make QSlider work in QSystemTrayIcon

I'm trying to create an application for brightness control in Ubuntu 13.04. The idea is to make a tray icon and slider which appears as the icon is pressed. The problem is that the tray menu contains just an empty item. Here is the block of code,…
Hrobak
  • 21
  • 2
2
votes
0 answers

QSlider memory leaks?

I have Qt 5.0 on linux 64 bit and I noticed something strange. I have small music player. Initially it has 14.4 MB in RAM. But after listen three songs it grow up to 26 MB and still growing. I thought that I have some memory leaks but valgrind show…
Dibo
  • 1,159
  • 17
  • 34
1 2
3
9 10