本篇Pyside6的第七篇,开启新功能了。单行文本编辑器。
class QLineEdit(QWidget):
"""
QLineEdit(self, arg__1: str, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None
QLineEdit(self, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None
"""
❝这里简单的告诉了你它可以怎么写。所以我们简单的试试。
❞
from PySide6.QtWidgets import QApplication, QWidget, QLineEdit
class Edit(QWidget):
def __init__(self):
super(Edit, self).__init__()
self.UI()
self.setGeometry(200,200,500,300)
self.setWindowTitle("QLineEdit")
self.show()
def UI(self):
# self.line = QLineEdit(self)
self.line = QLineEdit("请输入内容",self)
self.line.setGeometry(50,50,200,30)
if __name__ == &