-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.py
52 lines (43 loc) · 1.36 KB
/
mainwindow.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
import sys
from PyQt5.uic import loadUi
from PyQt5 import QtWidgets
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QApplication, QDialog
# import resource
# from model import Model
from out_window import Ui_OutputDialog
class Ui_Dialog(QDialog):
def __init__(self):
super(Ui_Dialog, self).__init__()
loadUi("mainwindow.ui", self)
self.runButton.clicked.connect(self.runSlot)
self._new_window = None
self.Videocapture_ = None
def refreshAll(self):
"""
Set the text of lineEdit once it's valid
"""
self.Videocapture_ = "0"
@pyqtSlot()
def runSlot(self):
"""
Called when the user presses the Run button
"""
print("Clicked Run")
self.refreshAll()
print(self.Videocapture_)
ui.hide() # hide the main window
self.outputWindow_() # Create and open new output window
def outputWindow_(self):
"""
Created new window for visual output of the video in GUI
"""
self._new_window = Ui_OutputDialog()
self._new_window.show()
self._new_window.startVideo(self.Videocapture_)
print("Video Played")
if __name__ == "__main__":
app = QApplication(sys.argv)
ui = Ui_Dialog()
ui.show()
sys.exit(app.exec_())