码迷,mamicode.com
首页 > 其他好文 > 详细

PyQt5-绝对定位+QLabel的创建-8

时间:2018-09-30 18:19:37      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:win   alt   tutorial   div   als   move   tco   .com   ogr   


 1 import sys
 2 from PyQt5.QtWidgets import  QWidget,QLabel,QApplication
 3 #demo_8: 绝对定位
 4 
 5 class Example(QWidget):
 6     def __init__(self):
 7         super().__init__()
 8         self.initUI()
 9 
10     def initUI(self):
11          label_1=QLabel(Zetcode,self)#文本内容,第二个参数标示这个文本放在那个窗体中,self即当前窗体
12          label_1.move(26,40)
13 
14          lbl2 = QLabel(tutorials, self)
15          lbl2.move(35, 40)
16 
17          lbl3 = QLabel(for programmers, self)
18          lbl3.move(55, 70)
19 
20          self.setGeometry(200,200,200,200)
21          self.setWindowTitle(绝对定位)
22          self.show()
23 if __name__==__main__:
24     app=QApplication(sys.argv)
25     e=Example()
26     sys.exit(app.exec())

 

 

技术分享图片

 

PyQt5-绝对定位+QLabel的创建-8

标签:win   alt   tutorial   div   als   move   tco   .com   ogr   

原文地址:https://www.cnblogs.com/ygzhaof/p/9732582.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!