Skip to content

QmlApplicationEngine

Qt Base Class: QQmlApplicationEngine

Signature: QQmlApplicationEngine(self, filePath: str, parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlApplicationEngine(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlApplicationEngine(self, uri: str, typeName: str, parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlApplicationEngine(self, url: Union[PySide6.QtCore.QUrl, str], parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
QmlEngineMixin
prettyqt.qml.qmlengine
QQmlApplicationEngine
PySide6.QtQml
QQmlApplicationEngine(self, filePath: str, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473572331584["qml.QmlApplicationEngine"]
  1473572315968["qml.QmlEngineMixin"]
  1473572333536["qml.JSEngineMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473572296448["QtQml.QQmlApplicationEngine"]
  1473572295472["QtQml.QQmlEngine"]
  1473572290592["QtQml.QJSEngine"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473572315968 --> 1473572331584
  1473572333536 --> 1473572315968
  1473299815024 --> 1473572333536
  140713234304496 --> 1473299815024
  1473572296448 --> 1473572331584
  1473572295472 --> 1473572296448
  1473572290592 --> 1473572295472
  1473288842240 --> 1473572290592
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: QmlEngineMixin, QQmlApplicationEngine

Convenient way to load an application from a single QML file.

Source code in prettyqt\qml\qmlapplicationengine.py
class QmlApplicationEngine(qml.QmlEngineMixin, qml.QQmlApplicationEngine):
    """Convenient way to load an application from a single QML file."""

    def __iter__(self) -> Iterator[QtCore.QObject]:
        return iter(self.rootObjects())

    def load_data(
        self,
        data: datatypes.ByteArrayType,
        url: datatypes.UrlType | os.PathLike | None = None,
    ):
        data = datatypes.to_bytearray(data)
        url = datatypes.to_local_url(url)
        self.loadData(data, url)

    def load_file(self, file: datatypes.UrlType | datatypes.PathType):
        if isinstance(file, os.PathLike):
            file = os.fspath(file)
        self.load(file)

⌗ Property table

Qt Property Type Doc
objectName QString
uiLanguage QString
offlineStoragePath QString