def main(): app = QGuiApplication(sys.argv) app.setApplicationName(metadata.get("Name")) # QQuickStyle.setStyle("Material") QmlEncryptedJSONStorage6.DICTIONARY = {"$apphome": home} engine = Paper() encryptedStorage = QmlEncryptedJSONStorage6() encryptedStorage._key = 26 engine.rootContext().setContextProperty("encryptedStorage", encryptedStorage) engine.init_ui() sys.exit(app.exec_())
#!/usr/bin/python # This Python file uses the following encoding: utf-8 import sys import os from PySide6.QtGui import QGuiApplication from PySide6.QtQml import QQmlApplicationEngine from PySide6 import QtCore, QtWidgets # created from /usr/lib/qt6/rcc -g python qml.qrc -o resources.py # converts the resources to bytes and can be called from qrc:/some/file.jpg import resources if __name__ == "__main__": QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts) app = QGuiApplication(sys.argv) app.setApplicationName("WeatherWidget") app.setOrganizationName("AllspiceInc") app.setOrganizationDomain("AllspiceInc") engine = QQmlApplicationEngine() engine.load(QtCore.QUrl("main.qml")) if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec())
and explains in which circumstances it is handy to use this control. """ import os import sys import platform from PySide6.QtGui import QGuiApplication, QIcon from PySide6.QtCore import QSettings, QUrl from PySide6.QtQml import QQmlApplicationEngine, QQmlContext from PySide6.QtQuickControls2 import QQuickStyle import rc_gallery if __name__ == "__main__": QGuiApplication.setApplicationName("Gallery") QGuiApplication.setOrganizationName("QtProject") app = QGuiApplication() QIcon.setThemeName("gallery") settings = QSettings() if not os.environ.get("QT_QUICK_CONTROLS_STYLE"): QQuickStyle.setStyle(settings.value("style", str)) engine = QQmlApplicationEngine() built_in_styles = ["Basic", "Fusion", "Imagine", "Material", "Universal"] if platform.system() == "Darwin": built_in_styles.append("macOS") elif platform.system() == "Windows":