Home >Backend Development >Python Tutorial >Some QtGui structures
The GUI in Qt helps organize and synchronize a number of parameters:
font = QtGui.QFont() font.setPointSize(10) self.pushButton.setFont(font) self.pushButton.setStyleSheet("background-color: rgb(255, 255, 255);") self.pushButton.setObjectName("pushButton") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1126, 26)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow)
After connecting the QtGui library, we can set the parameters and widgets we need on the graphical interface, while simultaneously naming them for the code.
Various classes, such as QPushButton, QMenuBar, QStatusBar, determine the coverage area of a particular object. Various modules resemble API methods in structure, and when you call each one you get the expected call.
<widget> <p>Don’t forget to describe each of the listed classes in XML for the correct layout of files when launched. Gui provides only the output image; you write the entire backend in other Qt modules.<br> It's better to store project files in one place, which will avoid explicitly writing their paths in the computer memory. If it's possible not to produce more files, write to everything in one. Python, unlike Java/C/Kotlin, doesn't allow structures that are difficult to compile.</p>
The above is the detailed content of Some QtGui structures. For more information, please follow other related articles on the PHP Chinese website!