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

Name Children Inherits
ObjectMixin
prettyqt.core.object
QQmlExpression
PySide6.QtQml
QQmlExpression(self) -> None

⋔ Inheritance diagram

graph TD
  1473572319872["qml.QmlExpression"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473572282784["QtQml.QQmlExpression"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473572319872
  140713234304496 --> 1473299815024
  1473572282784 --> 1473572319872
  1473288842240 --> 1473572282784
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 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