In this article we will see how we can do something the object name of the spin box is changed, object name is basically name given to the object of spin box, when we find the object in the PyQt5 application with the help of object name with the help of
findChild method. Object name can be set to the spin box with the help of
Implementation steps –
1. Create a spin box
2. Set its object name
3. Show the object name with the help of label
4. Add action to the spin box when object name is changed which make the suffix of spin box change
5. Create a push button
6. Add action to the push button change the object name of spin box
In order to add action when object name is changed we use
Syntax : spin_box.objectNameChanged.connect(method name)
Argument : It takes method name as argument
Action performed : It will call the passed method
Below is the implementation
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.