-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgui.py
56 lines (41 loc) · 1.38 KB
/
gui.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
47
48
49
50
51
52
53
54
import sys
from PyQt5.QtWidgets import qApp,QAction,QWidget,QApplication,QMessageBox,QPushButton,QMainWindow
from PyQt5.QtGui import *
from PyQt5.QtCore import QCoreApplication
class ee(QMainWindow):
def __init__(self):
super().__init__()
self.initui()
def initui(self):
self.setGeometry(111,222,333,444)
self.setWindowTitle('外窗口')
p=self.statusBar()
p.showMessage('ready')
p.setToolTip('aaa')
eac=QAction(QIcon(r'C:\Python34\1.jpg'),'&关闭',self)
eac.setShortcut('ctrl+q')
eac.setStatusTip('????')
eac.triggered.connect(qApp.quit)
ead=QAction('&7',self)
ead.setShortcut('ctrl+6')
tb=self.addToolBar()
self.setWindowTitle('menub')
self.setWindowIcon(QIcon(r'c:\python34\1.jpg'))
self.show()
def closeEvent(self,event):
reply=QMessageBox.question(self,'Message',
"Are you sure to quit?",QMessageBox.Yes |
QMessageBox.No,QMessageBox.No)
if reply==QMessageBox.Yes:
#event.accept()
event.accept()
else:
event.ignore()
app=QApplication(sys.argv)
e=ee()
#w=QWidget()
#w.resize(600,300)
#w.move(600,600)
#w.setWindowTitle('蛋')
#w.show()
sys.exit(app.exec_())