广告
返回顶部
首页 > 资讯 > 后端开发 > Python >PyQt5--QLineEdit
  • 604
分享到

PyQt5--QLineEdit

QLineEdit 2023-01-30 22:01:00 604人浏览 八月长安

Python 官方文档:入门教程 => 点击学习

摘要

1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9

 1 # -*- coding:utf-8 -*-
 2 '''
 3 Created on Sep 20, 2018
 4 
 5 @author: SaShuangYiBing
 6 
 7 Comment: 
 8 '''
 9 import sys
10 from PyQt5.QtWidgets import QApplication,QWidget,QLabel,QLineEdit
11 
12 class New_test(QWidget):
13     def __init__(self):
14         super().__init__()
15         self.initUI()
16     
17     def initUI(self):
18         self.lbl = QLabel(self)
19         qle = QLineEdit(self)
20         qle.move(60,100)
21         self.lbl.move(60,40)
22         
23         qle.textChanged.connect(self.onChange)
24         
25         self.setGeometry(300,300,280,170)
26         self.setWindowTitle('QLineEdit')
27         self.show()
28         
29     def onChange(self,text):
30         self.lbl.setText(text)
31         self.lbl.adjustSize()
32         
33 if __name__ == '__main__':
34     app = QApplication(sys.argv)
35     ex = New_test()
36     sys.exit(app.exec_())

 

 

--结束END--

本文标题: PyQt5--QLineEdit

本文链接: https://www.lsjlt.com/news/179662.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • PyQt5--QLineEdit
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QLineEdit
  • PyQt5实现QLineEdit正则表达式输入验证器
    本文主要介绍了QLineEdit正则表达式输入验证器,分享给大家,具体如下: from PyQt5 import QtWidgets, QtCore, QtGui, Qt imp...
    99+
    2022-11-12
  • PyQt5 QLineEdit输入的子网字符串校验QRegExp实现
    自己编写的用于对lineEdit编辑框输入的子网,例如:192.168.60.1/24字符串校验是否合规。 # 限制lineEdit编辑框只能输入./字符和数字 reg = Q...
    99+
    2022-11-12
  • Python中如何使用QLineEdit文本事件
    这篇文章给大家介绍Python中如何使用QLineEdit文本事件,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。一、qlineEdit使用QLineEdit它是一个单行文本框。事件:文本改变事件。Textchange类...
    99+
    2023-06-20
  • mac python3.9安装pyqt5、qt5、pyqt5-tools
    仅供参考,需要根据自己实际修改 !!!arm 架构建议直接使用pyqt6,不折腾pyqt5 pyqt6安装参考 PyQT6:看这一篇就够了 python PyQt6 常用操作以及常见问题解决 pych...
    99+
    2023-09-25
    qt macos linux python
  • PyQt5--QSplitter
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QSplitter
  • PyQt5--QPixmap
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QPixmap
  • PyQt5--QCalendar
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QCalendar
  • PyQt5--QFileDiaglog
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 17, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QFileDiaglog
  • PyQt5--QCheckBox
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QCheckBox
  • PyQt5--QProgressBar
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QProgressBar
  • PyQt5--QFontDiaglog
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 17, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QFontDiaglog
  • PyQt5--QColorDiaglog
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 17, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QColorDiaglog
  • PyQt5--QSlide
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QSlide
  • PyQt5--QToggleButton
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 '' 9 i...
    99+
    2023-01-30
    QToggleButton
  • PyQt5--TextDrag
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 21, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    TextDrag
  • PyQt5--QComboBox
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 20, 2018 4 5 @author: SaShuangYiBing 6 7 Comment: 8 ''' 9 ...
    99+
    2023-01-30
    QComboBox
  • PyQt5--MenuBar
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 13, 2018 4 5 @author: SaShuangYiBing 6 ''' 7 import sys 8 fro...
    99+
    2023-01-30
    MenuBar
  • PyQt5--GridLayoutMul
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 13, 2018 4 5 @author: SaShuangYiBing 6 ''' 7 import sys 8 fro...
    99+
    2023-01-30
    GridLayoutMul
  • PyQt5--GridLayout
    1 # -*- coding:utf-8 -*- 2 ''' 3 Created on Sep 13, 2018 4 5 @author: SaShuangYiBing 6 ''' 7 import sys 8 fro...
    99+
    2023-01-30
    GridLayout
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作