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
4 answers

Mapping QSlider::valueChanged signals in custom QWidget with multiple sliders

I have a custom QDialog with a set of custom sliders (i.e., QWidgets each consisting of a slider and an associated label) on it. In essence, this dialog is used to change the coordinates of an object in a 3D scene by adjusting the sliders for each…
norman
  • 5,128
  • 13
  • 44
  • 75
1
vote
0 answers

How can i make up slider with stop-points

Excuse me if such a topic already exists. I want a custom slider for scaling my scene. Smth like the one in windows explorer, that changes folders' sizes. But in horizontal direction, and it hadn't exactly looks like that one. Should I use qss, or…
Juriy
  • 565
  • 1
  • 5
  • 17
1
vote
2 answers

How to add image on the sides of a QSlider

I have redesigned and implemented a QSlider using its Stylesheets. I could not find how to place an image before and after (left or right, top or bottom) the slider itself though. Ex: Slider: ----00--------------- Image Left: qqqqq Image…
Phil
  • 13,875
  • 21
  • 81
  • 126
1
vote
1 answer

How to Set style sheet for a Phonon::SeekSlider in Qt

I want to know how can I set a style sheet for a Phonon::SeekSlider as like as a QSlider in Qt. With QSliders we can assign so many attributes by easily calling something like this. QSlider::handle:horizontal { background:white; border: 1px solid…
Thusitha
  • 3,393
  • 3
  • 21
  • 33
1
vote
1 answer

Position of QSlider in a widget

I am trying to draw a line between two sliders in Qt. When I move either of the sliders, I want the line to move such that it always joins the two sliders. See attached pic (I have drawn the line for illustration - not programatically) How do I do…
go4sri
  • 1,490
  • 2
  • 15
  • 29
1
vote
2 answers

use a created vector as range for QDoubleSpinBox and QSlider

I've created a vector v with 128 elements from -3000 to 3000 and I want to associate it to a QDoubleSpinBox and a QSlider, because dividing 6000 to 128 and setting the QDoubleSpinBox we have always the round problem. So can we set the range and the…
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102
1
vote
2 answers

How to use stylesheet to customize handle of QSlider on MacOS

On MacOS 10.6, the default handle of QSlider is a ball, if a QSlider has ticks, then the handle changes its appearence (one side arrow shape), I want this kind of handle, but I don't like the ticks Qt provides. So, I'd like to store that picture of…
Royt
  • 199
  • 4
  • 14
0
votes
1 answer

How to get the position of the first and the last tick mark in a Qslider?

I want to draw a tick mark for a qslider in paintEvent, so I should get the exact position of each tick mark. As you know, the handle of slider takes some space, so the first tick mark does not sit at the left/top position of the slider, there is…
Royt
  • 199
  • 4
  • 14
0
votes
1 answer

Qt C++ Connect QSlider to QWebView's setTextSizeMultiplier

How do I connect QSlider to QWebView's setTextSizeMultiplier in Qt? I want to web's text to get smaller or larger depending on the slider's value when it changes. This is how I'm trying to do it, but not getting anywhere: thesliderbar is QSlider and…
yanike
  • 827
  • 3
  • 13
  • 29
0
votes
0 answers

PyQt6 QSlider how to set groove color?

I want to set the groove color of a slider. The default is orange, below I try to set it to green but this does nothing .. what am I getting wrong? Maybe my naming is wrong. Can anyone correct the code below to set the lower portion of the slider to…
0
votes
1 answer

PyQt6 Slider not moving

I'm having trouble with a horizontal slider in Python and PyQt6. I can't move the darn thing with my mouse. What could it be? from PyQt6.QtCore import Qt from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QHBoxLayout, QSlider from…
0
votes
0 answers

Why tracking QMouseEvent in my custom slider is being triggered unpredictably?

I'm working on a custom slider on Qt, so I have a widget and a Slider in it promoted to my class called CustomSlider. In this class I'm using PaintEvent to draw some markers and an EventFilter to catch the mouse when hovers over those markers to…
BinaryTalk
  • 33
  • 5
0
votes
0 answers

Detect Slider move

I want to be able to detect if the slider has moved to a new position and then do some actions in another function called sl. Here is my code: import sys from PyQt5 import QtWidgets from PyQt5.QtCore import Qt from PyQt5.QtWidgets import…
lp roj
  • 1
  • 2
0
votes
1 answer

Why are my QLabels not dynamically created when creation is called with QSlider?

I am new to QtCreator. I am trying to make a slider and dynamically remove and recreate labels when I move the slider. I am able to create labels dynamically when I call it from constructor, but for some reason when I do the same via moving he…
Heikki
  • 341
  • 2
  • 18
0
votes
0 answers

How can I rebuild this Slider with QT-Designer?

I want to rebuild following Slider in QT Designer: enter image description here Does anyone now, how to create the Stylesheet of this Slider? I have some problems with the creating the correct stylesheet, that does what I want... Thanks