In this article we will see how we can find the child of spin box using the child type, child type is the quality of child for example push button type is QPushButton. Spin box is made of two child one is line edit whose type is QLineEdit and other is those up and down button whose type are QValidator.
In order to do this we use findChild method
Syntax : spin_box.findChild(child_type)
Argument : It takes child type as argument
Return : It returns the child object, if no child is found it return None
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.
- PyQt5 QSpinBox - Finding children using child type
- PyQt5 QSpinBox - Finding child using ID
- PyQt5 QSpinBox - Finding child through position
- PyQt5 QSpinBox - Checking if it is ancestor of given child
- PyQt5 QCalendarWidget - Getting child using its type
- PyQt5 QColorDialog - Child by the type
- PyQt5 QSpinBox - Setting step type
- PyQt5 QSpinBox - Accessing step type
- PyQt5 QSpinBox - Getting letter spacing type
- PyQt5 QCalendarWidget - Getting child using ID
- PyQt5 QSpinBox – Hiding it using setHidden method
- PyQt5 QSpinBox – Checking if it is visible using isVisible
- PyQt5 QSpinBox – Checking if it is hidden using isHidden
- PyQt5 QSpinBox – Making it visible using show method
- PyQt5 QSpinBox – Step up the value using stepUp method
- PyQt5 QSpinBox – Step down the value using stepDown method
- PyQt5 QSpinBox – Changing value using stepBy method
- PyQt5 QSpinBox - Checking if user can change value using keyboard or not
- PyQt5 QCalendarWidget - Getting Child of it at given co-ordinate
- PyQt5 QCalendarWidget - Making focus to next-previous child
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.