-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
44 lines (28 loc) · 906 Bytes
/
main.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
import sys
from PyQt6.QtGui import QGuiApplication
from PyQt6.QtQml import QQmlApplicationEngine
from PyQt6.QtCore import QObject, pyqtSignal, pyqtSlot
class Backend(QObject):
buttonClicked = pyqtSignal()
@pyqtSlot(str)
def search(self, str):
threadDriver(str)
def drawState(stateName,matchPercent):
print('str', str)
stateObject = False
if usMap.findChild(QObject, str) is None:
stateObject = True
print(stateObject)
app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
backend = Backend()
engine.rootContext().setContextProperty("backend", backend)
engine.quit.connect(app.quit)
engine.load('./ui/main.ui.qml')
usMap = engine.rootObjects()[0].children()[0].children()[0]
print('usMap', type(usMap))
states = usMap.children()
print('states', type(states))
for state in states:
print('state', type(state))
sys.exit(app.exec())