PyQt5 QDoubleSpinBox – Getting Prefix Last Updated : 28 Jul, 2020 Comments Improve Suggest changes Like Article Like Report In this article we will see how we can get prefix of the QDoubleSpinBox. A prefix is an affix which is placed before the stem of a word. Adding it to the beginning of one word changes it into another word. For example, when the prefix un- is added to the word happy, it creates the word unhappy. By default there is no prefix although a string can be added infront of the double spin box value with the help of setPrefix method. In order to do this we will use prefix method with the double spin box object. Syntax : dd_spin.prefix() 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, 500, 400) # calling method self.UiComponents() # showing all the widgets self.show() # method for components def UiComponents(self): # creating double spin box d_spin = QDoubleSpinBox(self) # setting geometry to the double spin box d_spin.setGeometry(100, 100, 150, 40) # setting prefix d_spin.setPrefix("Value : ") # step type step_type = QAbstractSpinBox.AdaptiveDecimalStepType # adaptive step type d_spin.setStepType(step_type) # creating a label label = QLabel("GeeksforGeeks", self) # setting geometry to the label label.setGeometry(100, 200, 300, 80) # making label multi line label.setWordWrap(True) # getting prefix value = d_spin.prefix() # setting text to the label label.setText("Prefix = " + str(value)) # 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 - Adding Prefix R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Python PyQt-QDoubleSpinBox Practice Tags : python Similar Reads PyQt5 QDoubleSpinBox â Getting Suffix In this article we will see how we can get the suffix of the QDoubleSpinBox. In linguistics, a suffix is an affix which is placed after the stem of a word. Common examples are case endings, which indicate the grammatical case of nouns or adjectives, and verb endings, which form the conjugation of ve 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 - Adding Prefix In this article we will see how we can add prefix to 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. In order to add prefix we will use spin_box.setPrefix method. Syntax : spin_box.se 1 min read PyQt5 QDoubleSpinBox - Getting Step Type Property In this article we will see how we can get the step type property of the QDoubleSpinBox. This property holds the step type. The step type can be single step or adaptive decimal step. By default when we change the value it get change by whole number not by the decimal value although we can change thi 2 min read PyQt5 QDoubleSpinBox â Getting Line Edit of it In this article we will see how we can get the line edit of the QDoubleSpinBox. Line edit is the white space which receives the input and shows the current value of the double spin box, we can change the line edit object any time with the help of setLineEdit method. Line edit is the main component o 2 min read PyQt5 QDoubleSpinBox â Setting Prefix In this article we will see how we can set prefix to the QDoubleSpinBox. A prefix is an affix which is placed before the stem of a word. Adding it to the beginning of one word changes it into another word. For example, when the prefix un- is added to the word happy, it creates the word unhappy. A st 2 min read Like