-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path1016-07-工具栏、菜单栏、状态栏整合.py
47 lines (34 loc) · 1.11 KB
/
1016-07-工具栏、菜单栏、状态栏整合.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/10/16 下午3:08
# @Author : Aries
# @Site :
# @File : 1016-07-工具栏、菜单栏、状态栏整合.py
# @Software: PyCharm
import sys
from PyQt5.QtWidgets import QMainWindow, QTextEdit,QApplication,qApp,QAction
from PyQt5.QtGui import QIcon
class Exp(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
text = QTextEdit()
self.setCentralWidget(text)
exitAction = QAction(QIcon('123.png'),'退出',self)
exitAction.setShortcut('Ctrl + Q')
exitAction.setStatusTip('Press and quit !')
exitAction.triggered.connect(qApp.quit)
menubar = self.menuBar()
fileMenu = menubar.addMenu('&列表')
fileMenu.addAction(exitAction)
self.statusBar()
tbar = self.addToolBar('Exit')
tbar.addAction(exitAction)
self.setGeometry(400,200,600,400)
self.setWindowTitle('整合')
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Exp()
sys.exit(app.exec_())