-
Notifications
You must be signed in to change notification settings - Fork 0
/
call_popup.py
51 lines (42 loc) · 1.37 KB
/
call_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
# ==> GUI FILE
from ui_popup import Ui_Popup
from PyQt5.QtCore import QTimer, QTime, Qt
import manager
from main import *
query = ""
temp = ""
class Popup(QMainWindow):
## ==> MAIN -> POPUP WINDOW
#============================
# POPUP ==> USER INPUT THROUGH ENTER KEY
def keyPressEvent(self, event):
global query
global temp
if event.key()=="":
self.close()
print('pass 4')
query = str(self.ui.a_input.text().lower())
# if temp == "btn":
# print("xxxx")
manager.manage(query,"userInput",self)
print(query)
# manage(Popup.input_text,"userInput",self) #Pass Query as a parameter
# print(Popup.input_text)
## TOOLS ==> USER INPUT
def userInput(title,btn="",self=""):
global query
global temp
temp = btn
main = Popup()
query = main.ui.a_input.text()
return query
def __init__(self):
Popup.input_text = ""
QMainWindow.__init__(self)
self.ui = Ui_Popup()
self.ui.setupUi(self)
# self.ui.title.setText(title)
self.setWindowFlags(Qt.FramelessWindowHint) # Remove title bar
self.setAttribute(Qt.WA_TranslucentBackground) # Set background to transparent
self.show()
self.ui.closebtn.clicked.connect(lambda: self.close())