-
Notifications
You must be signed in to change notification settings - Fork 33
/
test.py
executable file
·38 lines (27 loc) · 870 Bytes
/
test.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
#!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.setWindowTitle("test")
quit = QAction("&Quit", self)
quit.triggered.connect(self.close)
menu = self.menuBar().addMenu('&File')
menu.addAction(quit)
self.notepad = QTabWidget()
tabs = [("hello", QWidget(), "test")]
for i, (name, widget, title) in enumerate(tabs):
self.notepad.addTab(widget, title)
self.setCentralWidget(self.notepad)
self.statusBar().show()
def main(argv):
app = QApplication(argv)
app.setApplicationName("test")
win = MainWindow()
win.show()
return app.exec_()
if __name__ == '__main__':
sys.exit(main(sys.argv))