-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainWindow.py
More file actions
55 lines (45 loc) · 1.67 KB
/
Copy pathmainWindow.py
File metadata and controls
55 lines (45 loc) · 1.67 KB
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
import sys
import os
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QIcon
from PyQt5 import QtGui
from home_main import Ui_Dialog
from image_page_control import imageWindow
from video_page_control import videoWindow
import subprocess
class mainFile(QWidget):
def __init__(self):
super(mainFile,self).__init__()
# print("Main file")
self.mainGui = Ui_Dialog()
self.mainGui.setupUi(self)
self.mainGui.quit_button.clicked.connect(self.close)
self.mainGui.image_button.clicked.connect(self.open_image_window)
self.mainGui.video_button.clicked.connect(self.open_video_window)
icon_path = os.path.join(os.path.dirname(__file__), "GUI", "road_icon.png")
self.setWindowIcon(QIcon(icon_path))
def open_video_window(self):
self.hide()
self.video_window = videoWindow()
self.video_window.show()
self.video_window.videoGui.home_button_video.clicked.connect(self.show_main_window_after_video)
def open_image_window(self):
self.hide()
self.image_window = imageWindow()
self.image_window.show()
self.image_window.imageGui.home_button.clicked.connect(self.show_main_window)
# self.mainGui.close()
def show_main_window_after_video(self):
self.video_window.close()
self.show()
def show_main_window(self):
self.image_window.close()
self.show()
# def open_image_window_2(self):
# subprocess.Popen(['python',"image_page_control.py"])
if __name__ == '__main__':
app = QApplication(sys.argv)
ui = mainFile()
ui.show()
sys.exit(app.exec_())