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
0
votes
1 answer

How to add ToolTip to QSlider on mouse move

I want to have tooltip for QSlider showing the current value of slider on mouse move in QT C++
0
votes
1 answer

PyQt5 QSlider is off by one depending on which direction the slider is moved

I'm having a problem with the QSlider element in PyQt5. Below is a simplified version of my code that only calls the slider. I have two methods: One to print the slider value when it is moving, and one to print the slider value once the user…
Ryan Glanz
  • 67
  • 1
  • 5
0
votes
0 answers

PyQt5 How to rotate 3D object in displayed widget?

I need to rotate 3D objects with sliders in PyQt5. I can display custom cube or imported 3d mesh files but I can not connect rotation with sliders. I worked on an example and tried to rotate the cube with sliders. I added sliders, added the cube, I…
Metemel
  • 1
  • 3
0
votes
0 answers

How to add Lables at Tick Position in Slider in PyQt5?

At Every Position of Tick should be labeled For Example: I have slider and want to display time as tick label which should be customization as per video time length. As Like This Image I want to Label Time in format '10.55.AM'.
0
votes
1 answer

QSlider focus with a hotkey?

The QSlider documentation says, "A slider accepts focus on Tab and provides both a mouse wheel and a keyboard interface." Is there an easy way to assign a hotkey to it to give it focus similar to how one can assign an Alt key for QCheckboxes?
dwj
  • 3,443
  • 5
  • 35
  • 42
0
votes
2 answers

QSlider with ticks not properly drawn

Enabling a ticks for QSlider seems to mess up the sizeHint of the slider itself. Consider this simple code: #include int main(int argc, char *argv[]) { QApplication a(argc, argv); QSlider ds{Qt::Horizontal}; ds.setRange(0,…
Moia
  • 2,216
  • 1
  • 12
  • 34
0
votes
1 answer

QSlider not draggable when setting groove background

Whenever I set the groove of my QSlider to an image (as an image or background-image) or background-color (but not color) I am unable to drag it, but only move it by clicking on the slider to step it. Here is my current stylesheet for reference,…
0
votes
1 answer

Using drawComplexControl to retrieve QSliderHandle image

Today I was trying to take a picture of the QSlider handle in order to use it in an adpated QSlider widget with two handles. This is somewhat similar to the following question: Range slider in Qt (two handles in a QSlider) For a full fledged…
Aleph0
  • 5,816
  • 4
  • 29
  • 80
0
votes
1 answer

How to pass down the slider's value across different tabs?

I am currently doing a GUI using PyQt4. My question is the following : how to pass down the QtGui.QSlider's value across different QtGui.QTabWidget? Here is a minimal working example containing 3 tabs : import numpy as np from PyQt4 import QtCore,…
Yacola
  • 2,873
  • 1
  • 10
  • 27
0
votes
1 answer

QT QSlider Margins

I'm making a widget that consists of a QGridLayout which maps out a QSlider and a few QPushButtons. In my widget, I'm able to position the buttons against the rightmost side of the container widget. The slider, however, is a bit more problematic. I…
kwikness
  • 1,425
  • 4
  • 21
  • 37
0
votes
1 answer

Disable QSlider's valueChanged on keyboard arrow keys

How can I disable QSlider's emitting SIGNAL valueChanged on keyboard arrows and mouseWheel scroll. By setting ui->horizontalSlider->setFocusPolicy(Qt::NoFocus); the keyboards arrows keys are not emitting signals. How can I do the same for…
Sayan Bera
  • 135
  • 2
  • 16
0
votes
1 answer

How to make QSlider unclickable

I'm creating a GUI where I have a few sliders. I want each QSlider such that it can only be dragged. Sometimes, if I click on any part of a QSlider, the position of the slider changes. How can I stop that from happening?
Kaya311
  • 545
  • 2
  • 9
  • 21
0
votes
1 answer

QtLua capture slider value change

I am trying to make a simple UI using qtlua, in which I want to capture the slider value everytime it changes. I tried to connect to the valueChanged() signal, but qlua gives me the following error: cannot find source signal valueChanged() The code…
Partha Das
  • 170
  • 2
  • 11
0
votes
0 answers

PyQt5 QSlider value is always 0

I'm having an issue with PyQt5 QSlider. I have multiple QSliders in a Widget. Now I want to update a corresponding QLabel when the handle of the slider is released. Therefore I connected all sliders inside a for loop, where I pass the slider and the…
0
votes
0 answers

QSlider lags noticeably on UI

I'm using Qt 5.10. I'm trying to update a QImage with setPixMap and QLabel, by connecting the QSlider to a value changed signal, but the QSlider lags noticeably when I slide it normally. I found a related question but the answers aren't helpful: qt…
ALH
  • 85
  • 4
  • 14