• 大小:
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-02
  • 语言: 其他
  • 标签: PyQt5  

资源简介

PyQt5开发与实战源代码

资源截图

代码片段和文件信息

# -*- coding: utf-8 -*-

import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

class Example(QWidget):
def __init__(self):
super(Example self).__init__()
self.initUI()

def initUI(self): 
hbox = QHBoxLayout( )
self.l1 = QLabel(“拖动滑块改变颜色“)
self.l1.setFont(QFont(“Arial“16))
hbox.addWidget(self.l1)
self.s1 = QScrollBar()
self.s1.setMaximum(255)
self.s1.sliderMoved.connect(self.sliderval)
self.s2 = QScrollBar()
self.s2.setMaximum(255)
self.s2.sliderMoved.connect(self.sliderval)
self.s3 = QScrollBar()
self.s3.setMaximum(255)
self.s3.sliderMoved.connect(self.sliderval)
hbox.addWidget(self.s1)
hbox.addWidget(self.s2)
hbox.addWidget(self.s3)
self.setGeometry(300 300 300 200)
self.setWindowtitle(‘字体例子‘)
self.setLayout( hbox )

def sliderval(self):
print( self.s1.value()self.s2.value() self.s3.value() )
palette = QPalette()
c = QColor(self.s1.value()self.s2.value() self.s3.value()255)
palette.setColor(QPalette.Foregroundc)
self.l1.setPalette(palette)

if __name__ == ‘__main__‘:
app = QApplication(sys.argv)
demo = Example() 
demo.show()
sys.exit(app.exec_())

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-11-01 02:02  PyQt5-master\
     目录           0  2017-11-01 02:02  PyQt5-master\Chapter01\
     目录           0  2017-11-01 02:02  PyQt5-master\Chapter01\EricPro01\
     文件        1620  2017-11-01 02:02  PyQt5-master\Chapter01\EricPro01\FirstPyQtPro.e4p
     文件         620  2017-11-01 02:02  PyQt5-master\Chapter01\EricPro01\FirstWin.py
     文件           0  2017-11-01 02:02  PyQt5-master\Chapter01\EricPro01\__init__.py
     目录           0  2017-11-01 02:02  PyQt5-master\Chapter01\EricPro01\_eric6project\
     文件         246  2017-11-01 02:02  PyQt5-master\Chapter01\EricPro01\_eric6project\FirstPyQtPro.e4q
     文件         240  2017-11-01 02:02  PyQt5-master\Chapter01\EricPro01\_eric6project\FirstPyQtPro.e6t
     文件         389  2017-11-01 02:02  PyQt5-master\Chapter01\FirstWin.py
     文件         265  2017-11-01 02:02  PyQt5-master\Chapter01\qt101_testPyQt.py
     文件         397  2017-11-01 02:02  PyQt5-master\Chapter01\qt102_PrintApi.py
     文件         320  2017-11-01 02:02  PyQt5-master\Chapter01\qt103_runPyQt.py
     目录           0  2017-11-01 02:02  PyQt5-master\Chapter02\
     文件         335  2017-11-01 02:02  PyQt5-master\Chapter02\py201math.py
     文件         324  2017-11-01 02:02  PyQt5-master\Chapter02\py202str.py
     文件         892  2017-11-01 02:02  PyQt5-master\Chapter02\py203str2.py
     文件         310  2017-11-01 02:02  PyQt5-master\Chapter02\py204list.py
     文件         310  2017-11-01 02:02  PyQt5-master\Chapter02\py205tuple.py
     文件         334  2017-11-01 02:02  PyQt5-master\Chapter02\py206dict.py
     文件         391  2017-11-01 02:02  PyQt5-master\Chapter02\py207ctrl.py
     文件         223  2017-11-01 02:02  PyQt5-master\Chapter02\py208fun.py
     文件         358  2017-11-01 02:02  PyQt5-master\Chapter02\py209fun.py
     文件         136  2017-11-01 02:02  PyQt5-master\Chapter02\py210fun.py
     文件         416  2017-11-01 02:02  PyQt5-master\Chapter02\py211class.py
     文件         794  2017-11-01 02:02  PyQt5-master\Chapter02\py212privateProperty.py
     文件         582  2017-11-01 02:02  PyQt5-master\Chapter02\py213property01.py
     文件         524  2017-11-01 02:02  PyQt5-master\Chapter02\py213property02.py
     目录           0  2017-11-01 02:02  PyQt5-master\Chapter03\
     文件         439  2017-11-01 02:02  PyQt5-master\Chapter03\CallFirstMainWin.py
     文件         436  2017-11-01 02:02  PyQt5-master\Chapter03\CallMainWin02.py
............此处省略629个文件信息

评论

共有 条评论