forked from cgleone/gui_v0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.py
66 lines (48 loc) · 2.33 KB
/
view.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
61
62
63
64
65
66
import os
from PyQt5.QtGui import QPixmap, QBrush, QColor, QFont
from screens.patient_select import PatientSelectScreen
from screens.home import HomeScreen
from screens.report_screen import ReportScreen
from screens.correct_label_dialog import CorrectLabelDialog
# Import QApplication and the required widgets from PyQt5.QtWidgets
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QWidget
import PyQt5.QtWebEngineWidgets
#import PyQt5.QtGui.QAbstractItemView.NoEditTriggers
from PyQt5.QtCore import Qt, QObject, pyqtSignal, QThread, QPersistentModelIndex, \
QEvent, QModelIndex
from PyQt5.QtWidgets import QLabel, QStatusBar, QDialog, QTableWidgetItem, QHeaderView, \
QLineEdit, QGridLayout, QTableWidget, QPushButton, QVBoxLayout, QHBoxLayout, QFileDialog, QCheckBox, \
QButtonGroup, QListWidget, QListWidgetItem, QStackedWidget, QTabWidget
class View(QMainWindow):
"""Test App View (GUI)."""
def __init__(self):
"""View initializer."""
super().__init__()
self.home = HomeScreen()
self.patient_select = PatientSelectScreen()
self.report_screen = ReportScreen()
# window size and title
self.setWindowTitle("EMR Report Viewer")
self.setFixedSize(1000,700)
self.current_dialog = CorrectLabelDialog()
# self.create_settings_dialog_for_later()
self.stacked_widget = QStackedWidget()
self.stacked_widget.addWidget(self.home)
self.stacked_widget.addWidget(self.patient_select)
self.stacked_widget.addWidget(self.report_screen)
self.setCentralWidget(self.stacked_widget)
self.go_to_home()
def go_to_home(self):
self.stacked_widget.setCurrentWidget(self.home)
def go_to_patient_select(self):
self.stacked_widget.setCurrentWidget(self.patient_select)
def go_to_report_screen(self):
self.stacked_widget.setCurrentWidget(self.report_screen)
def set_table_row_count(self, row_count, table):
table.setRowCount(row_count)
def open_label_correction_dialog(self, filename, report_name, isPDF, report_labels, current_institutions):
self.current_dialog.reset_dialog()
self.current_dialog.report_clicked(filename, report_name, isPDF, report_labels, current_institutions)
def close_label_correction_dialog(self):
self.current_dialog.close()