This repository contains examples of integrating Python with QML using PySide6. It demonstrates various ways to create desktop applications using Qt's QML with Python as the backend.
hello-world-qml/
├── hello-world/ # Basic QML window example
│ ├── App/
│ │ ├── Main.qml
│ │ └── qmldir
│ └── main.py
├── py-qml-integration/ # Python-QML bridge example
│ ├── QmlIntegration/
│ │ ├── bridge.py # Python bridge class
│ │ ├── main.qml # QML interface
│ │ └── qmldir
│ └── main.py # Application entry point
└── random-window/ # Another example application
├── ui/
│ ├── main.qml
│ └── qmldir
└── main.py
- Python 3.7+
- PySide6
- Qt Quick Controls 2
- Clone the repository:
git clone https://github.com/yourusername/hello-world-qml.git- Install dependencies:
pip install PySide6Each directory contains a standalone example that can be run using Python:
# Run the basic hello-world example
cd hello-world
python main.py
# Run the Python-QML integration example
cd py-qml-integration
python main.py
# Run the random window example
cd random-window
python main.pyA basic QML window example showing how to set up a simple Qt Quick application.
Demonstrates how to create a bridge between Python and QML, allowing bidirectional communication between QML frontend and Python backend.
Additional example showing different aspects of QML and Python integration.
Feel free to contribute to this project by submitting issues or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.