Skip to content

QmlExpression

Qt Base Class: QQmlExpression

Signature: QQmlExpression(self) -> None QQmlExpression(self, arg__1: PySide6.QtQml.QQmlContext, arg__2: PySide6.QtCore.QObject, arg__3: str, arg__4: Optional[PySide6.QtCore.QObject] = None) -> None QQmlExpression(self, arg__1: PySide6.QtQml.QQmlScriptString, arg__2: Optional[PySide6.QtQml.QQmlContext] = None, arg__3: Optional[PySide6.QtCore.QObject] = None, arg__4: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

⋔ Inheritance diagram

🛈 DocStrings

Bases: ObjectMixin, QQmlExpression

Evaluates JavaScript in a QML context.

Source code in prettyqt\qml\qmlexpression.py
class QmlExpression(core.ObjectMixin, qml.QQmlExpression):
    """Evaluates JavaScript in a QML context."""

    def get_source_file(self) -> pathlib.Path | None:
        return pathlib.Path(source) if (source := self.sourceFile()) else None

    def get_error(self) -> qml.QmlError:
        return qml.QmlError(self.error())

⌗ Property table

Qt Property Type Doc
objectName QString