Skip to content

QmlComponent

Qt Base Class: QQmlComponent

Signature: QQmlComponent(self, arg__1: PySide6.QtQml.QQmlEngine, fileName: str, mode: PySide6.QtQml.QQmlComponent.CompilationMode, parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlComponent(self, arg__1: PySide6.QtQml.QQmlEngine, fileName: str, parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlComponent(self, arg__1: PySide6.QtQml.QQmlEngine, parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlComponent(self, arg__1: PySide6.QtQml.QQmlEngine, url: Union[PySide6.QtCore.QUrl, str], mode: PySide6.QtQml.QQmlComponent.CompilationMode, parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlComponent(self, arg__1: PySide6.QtQml.QQmlEngine, url: Union[PySide6.QtCore.QUrl, str], parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlComponent(self, engine: PySide6.QtQml.QQmlEngine, uri: str, typeName: str, mode: PySide6.QtQml.QQmlComponent.CompilationMode, parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlComponent(self, engine: PySide6.QtQml.QQmlEngine, uri: str, typeName: str, parent: Optional[PySide6.QtCore.QObject] = None) -> None QQmlComponent(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QQmlComponent
PySide6.QtQml
QQmlComponent(self, arg__1: PySide6.QtQml.QQmlEngine, fileName: str, mode: PySide6.QtQml.QQmlComponent.CompilationMode, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473572327680["qml.QmlComponent"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473572289616["QtQml.QQmlComponent"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473572327680
  140713234304496 --> 1473299815024
  1473572289616 --> 1473572327680
  1473288842240 --> 1473572289616
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ObjectMixin, QQmlComponent

Encapsulates a QML component definition.

Source code in prettyqt\qml\qmlcomponent.py
class QmlComponent(core.ObjectMixin, QtQml.QQmlComponent):
    """Encapsulates a QML component definition."""

    def get_status(self) -> str:
        return STATUS.inverse[self.status()]

    def get_url(self) -> core.Url:
        return core.Url(self.url())

    def load_url(self, url: datatypes.UrlType, mode: str):
        if isinstance(url, str):
            url = core.Url.from_user_input(url)
        self.loadUrl(url, COMPILATION_MODES[mode])

⌗ Property table

Qt Property Type Doc
objectName QString
progress double
status QQmlComponent::Status
url QUrl