def main(): import sys QGuiApplication.setApplicationName("Gallery") QGuiApplication.setOrganizationName("QtProject") QGuiApplication.setAttribute(Qt.AA_EnableHighDpiScaling) app = QGuiApplication(sys.argv) QIcon.setThemeName("gallery") settings = QSettings() style = QQuickStyle.name() if style: settings.setValue("style", style) else: QQuickStyle.setStyle(settings.value("style")) engine = QQmlApplicationEngine() engine.rootContext().setContextProperty("availableStyles", QQuickStyle.availableStyles()) engine.load(QUrl("qrc:/gallery.qml")) if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec_())
def main(): import sys app = QGuiApplication(sys.argv) w = RasterWindow() w.show() sys.exit(app.exec_())
def main(): import sys QCoreApplication.setOrganizationName("QtExamples") QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling) # QtWebEngine::initialize() app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.load(QUrl("qrc:/WebBrowser.qml")) sys.exit(app.exec_())
def main(): import sys QGuiApplication.setAttribute(Qt.AA_EnableHighDpiScaling) app = QGuiApplication(sys.argv) QFontDatabase.addApplicationFont(":/fonts/fontello.ttf") engine = QQmlApplicationEngine() engine.load(QUrl("qrc:/swipetoremove.qml")) if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec_())
def main(): import sys QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling) QCoreApplication.setOrganizationName("QtExamples") app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() engine.addImportPath(":/imports") engine.load(QUrl("qrc:/main.qml")) if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec_())
def main(): import sys QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling) QCoreApplication.setOrganizationName("QtExamples") app = QGuiApplication(sys.argv) view = QQuickView() view.engine().quit.connect(app.quit) view.setSource(QUrl("qrc:/demos/calqlatr/calqlatr.qml")) if view.status() == QQuickView.Error: sys.exit(-1) view.setResizeMode(QQuickView.SizeRootObjectToView) view.show() sys.exit(app.exec_())
def main(): import sys QGuiApplication.setApplicationName("Automotive") QGuiApplication.setOrganizationName("QtProject") QGuiApplication.setAttribute(Qt.AA_EnableHighDpiScaling) QGuiApplication.setAttribute(Qt.AA_UseHighDpiPixmaps) app = QGuiApplication(sys.argv) QIcon.setThemeName("automotive") engine = QQmlApplicationEngine() engine.load(QUrl("qrc:/qml/automotive.qml")) if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec_())
def main(): import os import sys QCoreApplication.setOrganizationName("QtExamples") QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling) app = QGuiApplication(sys.argv) os.environ["QT_QUICK_CONTROLS_STYLE"] = "Material" engine = QQmlApplicationEngine() isEmbedded = False engine.rootContext().setContextProperty("isEmbedded", isEmbedded) engine.load(QUrl("qrc:/qml/main.qml")) sys.exit(app.exec_())