QPushButton 按钮
button.clicked.connect(function)
button.setText(text)
button.setEnabled(False)
button.setEnabled(True)
from PySide2.QtCore import Qt,QSize
from PySide2.QtGui import QIcon
button.setIcon(QIcon('logo.png'))
button.setIconSize(QSize(30, 30))
QLineEdit 单行文本框
edit.textChanged.connect(function)
edit.returnPressed.connect(function)
edit.focusOutEvent.connect(function)
edit.editingFinished.connect(function)
text = edit.text()
edit.setText('你好')
edit.clear()
edit.copy()
edit.paste()
QPlainTextEdit 多行纯文本框
edit.textChanged.connect(function)
edit.cursorPositionChanged.connect(function)
text = edit.toPlainText()
textCursor = edit.textCursor()
selection = textCursor.selectedText()
edit.setPlaceholderText('请在这里输入薪资表')
edit.setPlainText(''hello'')
edit.appendPlainText('你好')
edit.insertPlainText('你好,白月黑羽')
edit.clear()
edit.paste()
edit.document().setMaximumBlockCount(1000)
QTextBrowser 文本浏览框
textBrowser.append('你好')
textBrowser.append('你好')
textBrowser.ensureCursorVisible()
edit.insertPlainText('你好')
QLabel 标签
label.setText(text)
label.text()
QComboBox 组合选择框
combobox.currentIndexChanged.connect(function)
combobox.addItem('你好')
combobox.addItems(['aaa','bbb','ccc'])
combobox.clear()
a = combobox.currentText()