首页 > 其他 > 详细

常用控件

时间:2020-01-31 17:49:27      阅读:46      评论:0      收藏:0      [点我收藏+]

Label控件

# -*- coding:utf-8 -*-
from PyQt5.Qtwidgets import QApplication, QMainWindow, QLabel
from sys
# 导入第三方库
if __name__ == "__main__":
   app = QApplication(sys.argv)
   win_root = QMainWindow()
   win_root.resize(600, 600)# 重置窗口大小
   win_root.setWindowTitle("添加Label的例子")
   # 为窗口添加Label控件
   """start"""
   Label = QLabel()
   Label.setText("这是一个标签")# 为标签设置内容
   Label.setParent(win_root)# 将Label添加到win_root
   Label.show()# 显示Label
   """end"""
   win_root.show()
   sys.exit(app.exec_())
后续更新........

常用控件

原文:https://www.cnblogs.com/MindBin/p/12245732.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!