Skip to content

PyQt QSlider with QLabel(QLabel is on the left side, QSlider is on the right side, horizontal direction only) QLabel's value synchronizes with QSlider's value.

License

Notifications You must be signed in to change notification settings

yjg30737/pyqt-label-slider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyqt-label-slider

PyQt QSlider with QLabel(QLabel is on the left side, QSlider is on the right side, horizontal direction only) QLabel's value synchronizes with QSlider's value.

Requirements

PyQt5 >= 5.8

Setup

python pip -m install pyqt-label-slider

Usage

  • getSlider() to get QSlider.
  • getLabel() to get QLabel.

Note

  • Tick interval is set at 10.

Example

Code Sample

from PyQt5.QtWidgets import QApplication, QMainWindow
from pyqt_label_slider.labelSlider import LabelSlider


class Example(QMainWindow):
    def __init__(self):
        super().__init__()
        self.__initUi()

    def __initUi(self):
        widget = LabelSlider()
        slider = widget.getSlider()
        slider.setMaximumWidth(150)
        slider.setRange(10, 200)
        self.setCentralWidget(widget)


if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    ex = Example()
    ex.show()
    sys.exit(app.exec_())

Result

example.mp4

About

PyQt QSlider with QLabel(QLabel is on the left side, QSlider is on the right side, horizontal direction only) QLabel's value synchronizes with QSlider's value.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages