Skip to main 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.

Project description

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

https://user-images.githubusercontent.com/55078043/148164060-30f842f1-a64e-4553-abba-f37c7d0f8365.mp4

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqt-label-slider-0.0.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

pyqt_label_slider-0.0.1-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page