PyQt5 QSpinBox – Hiding the spin box Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report In this article we will see how we can hide the spin box, while making GUI(Graphical User Interface) when the use of widget get completed there is a need to remove the widget from the screen in order to do this we can hide the spin box. In order to do this we will use hide() method. Syntax : spin_box.hide() Argument : It takes no argument Return : It returns None Below is the implementation Python3 # 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, 150, 40) # creating a push button button = QPushButton("Click", self) # setting geometry to the button button.setGeometry(200, 200, 100, 40) # adding action to the push button button.pressed.connect(self.do_something) # action called by the button def do_something(self): # hiding the spin box self.spin.hide() # create pyqt5 app App = QApplication(sys.argv) # create the instance of our Window window = Window() # start the app sys.exit(App.exec()) Output : Comment More infoAdvertise with us Next Article PyQt5 QSpinBox â Making spin box visible R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Python PyQt-SpinBox Practice Tags : python Similar Reads PyQt5 QSpinBox â Closing the spin box In this article we will see how we can close the spin box, while making GUI(Graphical User Interface) when the use of widget get completed there is a need to remove the widget from the screen it can be done by hiding it but best of doing this is by closing the widget. In order to do this we will use 2 min read PyQt5 QSpinBox â Making spin box visible In this article we will see how we can make the spin box visible with the help of setVisible 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 setVisible method. Syntax : spin_box.setVisible(bool) Argument : It takes bool 2 min read PyQt5 QSpinBox â Adding skin In this article we will see how we can set skin to the spin box for its various states. There are basically three states of the spin box one is normal state, second is the hover state i.e when cursor is on the spin box and third is the pressed state i.e when mouse button is pressed. Skin is basicall 2 min read PyQt5 QSpinBox - Making spin box interprets the text In this article we will see how we can make the spin box interprets the text. Interpreting of text means to examine the text and finding essential information from it. If the value has changed since last interpretation then signals will be emitted. In order to do this we use interpretText method wit 2 min read PyQt5 QSpinBox - Setting Style Hint In this article we will see how we can set the style hint of the spin box text. Style hints are used by the font matching algorithm to find an appropriate default family if a selected font family is not available. There are many styles hints offered by the spin box like AnyStyle, SansSerif, Times et 2 min read PyQt5 QSpinBox - Blocking Signals In this article we will see how we can block the signals of the spin box, blocking signals means the connected methods with the spin box will not receive the signals for example when we add action to it when its value changes that action will not work. Signals emitted while being blocked are not buf 2 min read Like