PyQt5 QSpinBox – Accessing object name Last Updated : 10 May, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we will see how we can access the object name of the spin box, 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 setObjectName method. In order to do this we will use objectName method. Syntax : spin_box.objectName() Argument : It takes no argument Return : It returns string 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, 150, 40) # setting suffix to spin self.spin.setSuffix(" Spin Box") # name name = "Geeky" # setting up object name self.spin.setObjectName(name) # creating label label = QLabel(self) # setting geometry label.setGeometry(100, 200, 300, 40) # getting object name get_name = self.spin.objectName() # setting text to the label label.setText("Object Name : " + get_name) # 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 - Accessing Family Name R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Python PyQt-SpinBox Practice Tags : python Similar Reads PyQt5 QSpinBox - Accessing Family Name In this article we will see how we can get the family name of the font of spin box. The family name may optionally also include a foundry name, e.g. "Helvetica [Cronyx]". If the family is available from more than one foundry and the foundry isn't specified, an arbitrary foundry is chosen. If the fam 2 min read PyQt5 QCommandLinkButton - Accessing Object Name In this article we will see how we can get the object name of the QCommandLinkButton. Object name is given for searching the specific button inside the window programmatically, also object name can be used for setting stylesheet using object name. By default developer has not set any object name to 2 min read PyQt5 QSpinBox â Accessing caption In this article we will see how we can access the caption of the spin box, caption is basically the heading of the spin box but it is not visible caption is for only back end purposes. Caption of spin box is similar to the caption of the main window. In order to do so we use windowTitle method. Synt 2 min read PyQt5 QSpinBox - Getting accessible name In this article we will see how we can get the name of the spin box, name is basically used to distinguish spin box with each other, programmer can name the spin box according to its use so that they can be easily distinguishable, by default no name is given to the combo box. Name can be set using s 2 min read PyQt5 QSpinBox - Accessing Prefix In this article we will see how we can access the prefix of the spin box, prefix is basically the text which is inserted before the value of spin box, prefix remain constant for each value of spin box i.e it is not editable. By default no prefix is set to the spin box we use setPrefix method to set 2 min read PyQt5 QSpinbox - Accessing the line edit object of it In this article we will see how we can access the line edit object of the spin box, line edit is widget in PyQt5 which is used to display text and accept the input text. By default spin box has its own line edit object although we can add our own line edit object to it with the help of setLineEdit m 2 min read Like