-
Notifications
You must be signed in to change notification settings - Fork 0
/
Popup.py
75 lines (64 loc) · 2.25 KB
/
Popup.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
67
68
69
70
71
72
73
74
75
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import sys
from PyQt5.QtWidgets import QLabel
import cv2
import pose_module
import Popup
import menu as osScript
class Window(QMainWindow):
def __init__(self):
super().__init__()
img = QImage("Dataset/last.png")
palette = QPalette()
palette.setBrush(QPalette.Window, QBrush(img))
self.setPalette(palette)
self.setMinimumSize(QSize(600, 400))
# setting title
self.setWindowTitle("YAYYY!!! You have reached the target")
self.showbutton()
self.show()
def showbutton(self):
pushButton1 = QPushButton("Back", self)
#pushButton.pressed.connect(self.show_popup)
pushButton1.resize(120, 40)
pushButton1.move(250, 250)
pushButton1.setFont(QFont('Times', 11))
pushButton1.setStyleSheet("QPushButton"
"{"
"background-color : yellow;"
"}"
"QPushButton::hover"
"{"
"background-color : lightyellow;"
"}")
pushButton1.pressed.connect(self.launch_script)
pushButton2 = QPushButton("Quit", self)
# pushButton.pressed.connect(self.show_popup)
pushButton2.resize(120, 40)
pushButton2.move(430, 250)
pushButton2.setFont(QFont('Times', 11))
pushButton2.setStyleSheet("QPushButton"
"{"
"background-color : yellow;"
"}"
"QPushButton::hover"
"{"
"background-color : lightyellow;"
"}")
pushButton2.pressed.connect(self.AppClose)
def AppClose(self):
self.close()
cv2.destroyAllWindows()
def launch_script(self):
self.close()
cv2.destroyAllWindows()
self.panel = osScript.MainWindow()
self.panel.show()
# create pyqt5 app
App = QApplication(sys.argv)
# create the instance of our Window
#window = Window()
# start the app
#sys.exit(App.exec())