def main(): exit_on_ctrl_c() if '--automation_server' in sys.argv: pqaut.start_automation_server() if 'FREEZETIME' in os.environ: freeze_time(os.environ['FREEZETIME'], tz_offset=0).start() app = QApplication(sys.argv) qmlRegisterType(status_screen.StatusScreen, 'Screens', 1, 0, 'StatusScreen') qmlRegisterType(now_playing.NowPlaying, 'Widgets', 1, 0, 'NowPlaying') qmlRegisterType(marquee.Marquee, 'Widgets', 1, 0, 'Marquee') qmlRegisterType(model.project.Project, 'Model', 1, 0, 'Project') qmlRegisterType(model.projects_model.ProjectsModel, 'Model', 1, 0, 'ProjectsModel') window = main_window.MainWindow() window.showFullScreen() mqtt = mqtt_service.MqttService() mqtt.start() sys.exit(app.exec_())
#!/usr/bin/env python import os, sys sys.path.append(os.path.abspath('.')) import pqaut.server as pqaut from PyQt5.QtWidgets import QApplication, QWidget, QLabel class Root(QWidget): def __init__(self): super(QWidget, self).__init__() label = QLabel('This is QLabel.text', self) label.setGeometry(0,0,400,100) self.show() pqaut.start_automation_server() app = QApplication(sys.argv) root = Root() sys.exit(app.exec_())
#!/usr/bin/env python import os, sys sys.path.append(os.path.abspath('.')) import pqaut.server as pqaut import PyQt5.Qt as Qt pqaut.start_automation_server() app = Qt.QApplication(sys.argv) engine = Qt.QQmlEngine() component = Qt.QQmlComponent(engine) component.loadUrl(Qt.QUrl('test_apps/9_qml_app.qml')) for error in component.errors(): print(error.description()) window = component.create() window.show() sys.exit(app.exec_())