-
Notifications
You must be signed in to change notification settings - Fork 2
/
GUI.py
37 lines (28 loc) · 1008 Bytes
/
GUI.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
import sys
from PyQt6.QtWidgets import QApplication, QPushButton, QVBoxLayout, QWidget
import videocapture
# Subclass QMainWindow to customize your application's main window
class MainWindow(QWidget):
def __init__(self):
super().__init__()
self.resize(600,400)
self.setWindowTitle("StudyCam")
layout = QVBoxLayout()
self.setLayout(layout)
self.startstop = QPushButton("Start")
self.startstop.clicked.connect(self.updateStartStop)
layout.addWidget(self.startstop)
def updateStartStop(self):
if (self.startstop.text() == "Start"):
videocapture.backend()
else:
self.startstop.setText("Start")
def updateDrinkWater(self):
if (self.drinkwater.text() == "stress"):
self.drinkwater.setText("time to work!")
else:
self.drinkwater.setText("Go back to work")
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec())