PyQt5 QSpinBox – Checking if children region is NULL or not Last Updated : 19 May, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we will see how we can check if the children region of spin box is NULL or not, children region holds the combined region occupied by the spin box’s children. In order to do this we use childrenRegion method. If we delete all the children of the spin box then this property will return an empty region. In order to do this we use isNull method. Syntax : children_region.isNull() Argument : It takes no argument Return : It returns bool Below is the implementation Python3 1== # importing libraries from PyQt5.QtWidgets import * from PyQt5 import QtCore, QtGui from PyQt5.QtGui import * from PyQt5.QtCore import * import sys class Window(QMainWindow): def __init__(self): super().__init__() # setting title self.setWindowTitle("Python ") # setting geometry self.setGeometry(100, 100, 600, 400) # calling method self.UiComponents() # showing all the widgets self.show() # method for widgets def UiComponents(self): # creating spin box self.spin = QSpinBox(self) # setting geometry to spin box self.spin.setGeometry(100, 100, 250, 40) # setting range to the spin box self.spin.setRange(0, 999999) # setting prefix to spin self.spin.setPrefix("Prefix ") # setting suffix to spin self.spin.setSuffix(" Suffix") # getting the children region children_region = self.spin.childrenRegion() # creating a label label = QLabel(self) # setting geometry to the label label.setGeometry(100, 200, 200, 30) # checking if children region is null check = children_region.isNull() # setting text to the label label.setText("Children Region is NULL ? " + str(check)) # create pyqt5 app App = QApplication(sys.argv) # create the instance of our Window window = Window() window.spin.setFocus() # start the app sys.exit(App.exec()) Output : Comment More infoAdvertise with us Next Article PyQt5 QSpinBox â Checking if children region is empty or not R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Python PyQt-SpinBox Practice Tags : python Similar Reads PyQt5 QSpinBox â Checking if children region is empty or not In this article we will see how we can check if the children region of spin box is empty or not, children region holds the combined region occupied by the spin boxâs children. In order to do this we use childrenRegion method. If we delete all the children of the spin box then this property will retu 2 min read PyQt5 QSpinBox â Checking if certain point is in the Children Region In this article we will see how we can check the certain point lies in the children region of spin box, children region holds the combined region occupied by the spin boxâs children. In order to do this we use childrenRegion method. Note : The point should be in the Spin box co-ordinates system In o 2 min read PyQt5 QSpinBox - Checking if it is read only In this article we will see how we can check if the spin box is read only or not, read only means that user will not be able to change the value of it. It is similar to making a spin box disabled but when spin box is disabled its other properties are turned off as well but in read only no one can ed 2 min read PyQt5 QSpinBox â Checking if it is hidden using isHidden In this article we will see how we can check if the spin box hidden with the help of isHidden method. We can hide the spin box using hide method or setHidden method. By default spin box is visible. In order to do so we use isHidden method. Syntax : class_object.spin_box.isHidden() Argument : It take 1 min read PyQt5 QSpinBox - Checking if margin is NULL ? In this article we will see how we can check if the margin of the spin box is NULL or not, by default it is set to zero although we can change this using setContentsMargins method with the spin box object. If any of the margin value is greater than 0 then spin box margin is not NULL. Note : When eac 2 min read PyQt5 QSpinBox â Checking if it is enabled or disabled In this article we will see how we can check if the spin box is enabled or disabled, disabled spin box is basically spin box that can't be edited i.e which get disabled and enabled spin box is normal spin box, by default spin box is enabled. In order to make spin box disabled we use setDisabled meth 2 min read Like