-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuse_disign.py
60 lines (47 loc) · 1.63 KB
/
use_disign.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
55
56
57
58
59
60
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import main_window_design
import child_window_design
import psycopg2
from PyQt5.QtCore import pyqtSlot, Qt
from PyQt5.QtWidgets import (QApplication, QWidget, QTableWidgetItem,
QMainWindow, QMessageBox)
class child_window(QWidget, child_window_design.Ui_Dialog):
def create_window(self):
super().__init__()
self.setupUi(self)
self.setWindowModality(Qt.ApplicationModal)
self.show()
self.buttonBox.clicked.connect()
def insert_stud(self):
pass
class main_window(QMainWindow, main_window_design.Ui_MainWindow):
def __init__(self):
super().__init__()
self.setupUi(self)
self.btn_add.clicked.connect(self.on_btn_add_click)
self.btn_remove.clicked.connect(self.on_btn_remove_click)
self.show()
def create_child_window(self):
self.child_window = child_window()
self.child_window.create_window()
self.child_window.exec_()
self.read_table()
@pyqtSlot()
def on_menuExit_click(self):
answer = QMessageBox.question(self, 'Exit', "You are shure?",
QMessageBox.Yes | QMessageBox.No,
QMessageBox.Yes)
if answer == QMessageBox.Yes:
pass # todo
def on_btn_add_click(self):
self.create_child_window()
# self.setWindowModality(ApplicationModal)
#
def on_btn_remove_click(self):
pass
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = main_window()
sys.exit(app.exec_())