PyQt5 QSpinBox – Adding action
In this article we will see how we can add action to the spin box, action basically a method called by spin box every time its value get changed. Adding action to the spin box as every time user change the value something should happen.
In order to add action we will use
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Syntax : spin_box.valueChanged.connect(method_name)
Argument : It takes method name as argument
Action performed : Every time the value of spin box changes method will get called
Implementation steps :
1. Create a spin box
2. Create label to show the value
3. Add action to the spin box
4. Inside the action method get the current value and show it through the label
Below is the implementations