PyQt5-絕對位置+QLabel的建立-8

來源:互聯網
上載者:User

標籤: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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.