bigscreen-tube/bigscreen_tube/__init__.py

29 lines
781 B
Python

import os
import sys
import locale
from PySide2.QtWidgets import QApplication
from PySide2.QtQuick import QQuickView
from PySide2.QtQml import QQmlApplicationEngine, qmlRegisterType, QQmlFileSelector
from PySide2.QtCore import QUrl
from .search import SearchController
from .mpv_player import MpvObject
def registerTypes():
qmlRegisterType(SearchController, 'BigScreenTube', 1, 0, 'SearchController')
qmlRegisterType(MpvObject, 'BigScreenTube', 1, 0, 'MpvObject')
def main():
app = QApplication()
engine = QQmlApplicationEngine()
selector = QQmlFileSelector(engine)
locale.setlocale(locale.LC_NUMERIC, 'C')
registerTypes()
engine.load(QUrl(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ui/main.qml')))
sys.exit(app.exec_())