Пример #1
0
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_())
Пример #2
0
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_())
Пример #3
0
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_())