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

🛈 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