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

C++ adding two QSliders together?

I have two QSlider-s/QSpinBox-es. Got those working but not sure about the best way of adding the two together to output the total. Here is a picture of what I got:
0
votes
1 answer

Seekslider realization in qt5

everybody. I'm rewriting my qt4 music player in qt5. And i cant make an proper seek slider, like in phonon. Do you have an simple example of realization that part of UI? UPD: here is my way to do…
kazak1377
  • 21
  • 5
0
votes
1 answer

Show QWidget with QSlider on top of tray icon

I'm trying to implement some kind of volume slider in Qt. I have added the QWidget with a QSlider on it. It works fine for me... But! QWidget shows on the screen center. But I need it on top of the tray icon. Does anybody knows how to do…
ddmytrenko
  • 796
  • 7
  • 16
0
votes
1 answer

displaying QSlider value in QLabel/QDebug() using QThread

I am implementing a simple function where slider value is constantly displayed on label and qDebug(). I already got the label updated using signal/slots, but somehow the qDebug() thread is not working properly. I expected to see the console flooded…
bladepopper
  • 23
  • 1
  • 5
0
votes
1 answer

How to change color of QWidget in QTableWidget

I have a QTableWidget. In its cells I need to display 3-state QSliders, that must change their color, depending form their state. -1 = red, 0 - normal, 1 - green. I tried to set QPalette to QSlider - whitout success. I tried to place QSlider into…
Sacha_D
  • 68
  • 1
  • 10
0
votes
1 answer

signal and slots for customized class

I have written a custom class for overriding the seek method of QSlider. Basically this class allows seeking on the slider where ever the user clicks . tbslider.h #ifndef TBSLIDER_H #define TBSLIDER_H #include #include class…
Vihaan Verma
  • 12,815
  • 19
  • 97
  • 126
-1
votes
1 answer

QT - Accessing QSlider within a QGroupBox

I am a newbie to QT. I'm using the Qt Designer to create a ui file then writing Python code to make things happen. I have a QSlider, and in the python code I can act when the value of the slider changes with this: widget =…
-1
votes
1 answer

Qslider won't pass parameter in PyQt5

my function won't work when the slider value changed i don't know why ? it's my first time using PyQt5. from PIL.ImageQt import Image, ImageQt from PIL import ImageEnhance from PyQt5.QtWidgets import (QApplication, QDialog, QGridLayout, …
-1
votes
1 answer

Slider in PyQt4

I am new to PyQt, I am trying to implement slider in PyQt4, but i don't know why code code is not generating any output. what i want is, create 3 slider to change 3 values dynamically. Here i am resizing font size of text "hue", "sat", "val". Is…
Vikas Gautam
  • 441
  • 8
  • 22
-1
votes
1 answer

Color of vertical slider of Qt

I created Vertical Slider with Qt Designer. But, the color fills reverse direction.Like this: Should I do to make the color in the correct direction.
Hiro
  • 1
-1
votes
1 answer

Slider reacting on mouse wheel in entire application

By default QSlider reacts on mouse wheel only when cursor is on it. I want to control slider by mouse wheel not matter where the cursor is (of course only when my application has focus). What's the best way to achieve that? I just learned that mouse…
leggo
  • 309
  • 2
  • 3
  • 11
-1
votes
1 answer

QSlider is not showing on widget (Qt)

I have simple tab with label and checkbox. I want to add slider, but slider is not showing. Method setGeometry wrong there? RollsTab::RollsTab(QWidget *parent) : QWidget(parent) { QFont font("Times", 11); label1 = new…
Deng Won
  • 11
  • 5
1 2 3
9
10