Pyside6-第七篇-QLineEdit文本行编辑(内设案例)

本篇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, QLineEditclass 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__ == &

本文链接:https://my.lmcjl.com/post/14416.html

展开阅读全文

4 评论

留下您的评论.