A dial widget (QDial) is included in PyQT.. It looks like a volume control you often see on mix panels. It’s part of PyQt5.QtWidgets.
The look and feel of the QDial widget may change on operating systems. But the logic is the same on all platforms.
Related Course: Create GUI Apps with Python PyQt5
QDial
Dial Widget Example
It has a minimum and maximum which can be set with the methods setMinimum()
and setMaximum()
.
You can set the default value with setValue()
. If the value is changed you can call a method (.valueChanged.connect(self.sliderMoved)
).
The current value is .value()
.
Example
The example below creates a dial widget window. You can copy and paste the program to test it out. PyQt5 must be installed to run the program.
1 | from PyQt5.QtWidgets import * |
If you are new to Python PyQt, then I highly recommend this book.