最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

氣輕PyQt5 09 圖標(biāo)按鈕

2023-02-26 07:57 作者:氣輕  | 我要投稿

?

from PyQt5 import QtCore, QtGui

from PyQt5.QtWidgets import *

from PyQt5.QtGui import QFont, QIcon, QPixmap

from PyQt5.QtCore import Qt

import sys

?

class PyQt509(QWidget):

??? def __init__(self):

??????? super().__init__()

??????? self.initUI()

??? def initUI(self):

??????? self.setWindowTitle('氣輕PyQt5')??????????????? # 設(shè)置窗口標(biāo)題

??????? self.resize(420, 50)??????????????????????????? # 設(shè)置窗口大小

?

??????? self.edit = QLineEdit(self)???????????????????? # 輸入框

??????? self.edit.setGeometry(10, 0,240, 40)??????????? # 設(shè)置位置和大小

??????? self.edit.setText('edit')

??????? self.edit.setStyleSheet('background-color:#FFE4B5;color : #32CD32; \

???????????????? ???font: bold italic large /"Times New Roman/";font-size:25px')

??????? self.edit.returnPressed.connect(self.updateLabel)

?

??????? img = 'arrowsright.png'???????????????????????? # 按鈕圖標(biāo)

??????? self.btn = QPushButton('', self)

??????? self.btn.setGeometry(250, 0, 40, 40)

??????? self.btn.setIcon(QIcon(QPixmap(img)))

??????? self.btn.setFont(QFont('Arial',20))

??????? self.btn.clicked.connect(self.updateLabel)

?

??????? self.tag = QLabel(self)???????????????????????? # 設(shè)置label信息

??????? self.tag.setGeometry(290, 0,120, 40)??????????? # 設(shè)置位置和大小

??????? self.tag.setText('標(biāo)簽')

??????? self.tag.setToolTip('標(biāo)簽提示')???????????????? # 設(shè)置標(biāo)簽提示

??????? self.tag.setAlignment(Qt.AlignCenter)?????????? # 居中設(shè)置

??????????????????????????????????????????????????????? # 背景和前景顏色

??????? self.tag.setStyleSheet('background-color:yellow;color : #6495ED; \

??????????????????? font: bold italic large /"Times New Roman/";font-size:25px')

?

??????? self.show()

?

??? def updateLabel(self):

??????? edittext = self.edit.text()

??????? self.tag.setText(edittext)

?

if __name__ == '__main__':

??? app = QApplication(sys.argv)

??? window = PyQt509()

??? sys.exit(app.exec_())

?

執(zhí)行結(jié)果



氣輕PyQt5 09 圖標(biāo)按鈕的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
紫云| 卓资县| 织金县| 滨州市| 庆阳市| 翼城县| 嘉善县| 陆丰市| 彝良县| 英吉沙县| 读书| 太谷县| 福建省| 莱阳市| 泌阳县| 织金县| 西乌| 财经| 英吉沙县| 莱西市| 项城市| 台前县| 高密市| 花垣县| 通许县| 肥东县| 东宁县| 山西省| 都兰县| 巫山县| 孝感市| 汕尾市| 临桂县| 扬中市| 栾城县| 邻水| 莱阳市| 沁阳市| 浦城县| 房产| 佛坪县|