qml - Qt for Python (original) (raw)

Toggle table of contents sidebar

pyside6-qml

pyside6-qml mimics some capabilities of Qt’s qml runtime utility by directly invoking QQmlEngine/QQuickView. It enables prototyping with QML/QtQuick without the need to write any Python code that loads the QML files either through QQmlApplicationEngine or the QQuickView class. The tool also detects the QML classes implemented in Python and registers them with the QML type system.

Usage

Consider the example Extending QML - Plugins Example. This example does not have a Python file with a main function that initializes a QmlEngine to load the QML fileapp.qml. You can run the example by running

pyside6-qml examples/qml/tutorials/extending-qml/chapter6-plugins/app.qml -I examples/qml/tutorials/extending-qml/chapter6-plugins/Charts

The -I flag is used to point pyside6-qml to the folder containing Python files that implement QML classes.

Command Line Options

Here are all the command line options of pyside6-qml:

Arguments

pyside6-qml /path/to/test.qml

Options

Options that align with the qml runtime utility