-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqttest.py
More file actions
30 lines (24 loc) · 816 Bytes
/
qttest.py
File metadata and controls
30 lines (24 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
from PyQt5.QtWidgets import QApplication, QWidget,QPushButton,QLabel
from PyQt5.QtGui import QIcon,QPixmap,QPainter
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setGeometry(300, 300, 300, 300)
self.setWindowTitle('Icon')
self.button = QPushButton(self)
self.button.setText("按一下")
self.button.clicked.connect(self.test)
pixmap = QPixmap("G:/OneDrive/图片/琉璃神社壁纸包 2016年10月号/29.jpg")
lb1 = QLabel(self)
lb1.setPixmap(pixmap)
self.show()
def test(self):
print("阿勒 按到了")
pass
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())