Button properties
# Obtain a button btn = the QPushButton ( ' which is a button ' ) # requirements: the button into the window win btn 1.win which provides functions to inside, 2.btn provides functions, using a third party to associate them with 3 # window and the relationship between control is hierarchical relationships, parent-child hierarchy # to add a button inside the window # personal understanding, button's father was a window btn.setParent (win)
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QLineEdit
QPushButton, QLabel, QLineEdit need guide package
Text and edit box properties
# Text control label the QLabel = ( ' Account: ' ) # to add text to the inside window label.setParent (win) # edit box Edit = QLineEdit () # Specifies the edit box displays the position x and y, width and height control edit. setGeometry (40, 0, 120, 20 is ) # add window to edit box inside edit.setParent (win)