-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
53 lines (31 loc) · 1.51 KB
/
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
45
46
47
48
49
50
51
52
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os.path
from PyQt5.QtCore import QObject, Qt
from PyQt5.QtCore import QUrl
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQuick import QQuickView
from PyQt5.QtCore import pyqtProperty, QCoreApplication, QObject, QUrl
from PyQt5.QtQml import qmlRegisterType, QQmlComponent, QQmlEngine
from backend import customOpenCV #import CustomOpenCVItem #This works like a marvel
from backend import audioComponent #import CustomOpenCVItem #This works like a marvel
from backend import wifiComponent #import CustomOpenCVItem #This works like a marvel
#import myQML
app = QGuiApplication(sys.argv)
qmlRegisterType(customOpenCV.CustomOpenCVItem, 'myOpenCVmodule', 1, 0, 'CustomOpenCVItem') #UberImportant
qmlRegisterType(audioComponent.CustomAudioIndicatorItem, 'myAudioModule', 1, 0, 'CustomAudioIndicatorItem') #UberImportant
qmlRegisterType(wifiComponent.CustomWifiIndicatorItem, 'myWifiModule', 1, 0, 'CustomWifiIndicatorItem') #UberImportant
print('-----------------------------------------------------------------------')
qmlFile = 'main.qml'
#qmlFile = "qrc:data/"
view = QQuickView()
view.setResizeMode(QQuickView.SizeRootObjectToView)
view.engine().quit.connect(app.quit)
engine = view.engine()
view.setSource(QUrl(qmlFile)) # putting at the end didn't solve referenceError 'This is supposed to solve all referenceErrors
object = view.rootObject()
print('root object is ',object)
#object.ValueChanged.connect(printTest)
view.show()
sys.exit(app.exec_())