-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
-
b29e168e4 (dev), 2fc7b07a4 (dev), 95c410ff7 (dev), 45d97b4ba (dev)
Implement a skeleton version of AutoQmlBridge() to be made available in the PySide6.Qml modules that when wrapped across a type, should enable that type to be used from QML. This type should also be comptaible with QAbstractItemModel, so that it can be used with the View classes.
Example:
// main.py from PySide6.Qml import AutoQmlBridge class WeatherDataModel: def add_string(self, new_string: str): # Example method to demonstrate slot wrapping print(f"Added {new_string}") AutoQmlBridge(weather_data_model, data_type="List")
// main.qml import backend 1.0 ApplicationWindow { Column { anchors.centerIn: parent TextField { id: inputField placeholderText: "Enter a string" } Button { text: "Add String" onClicked: { WeatherDataModel.add_string(inputField.text) } } } }
- is required for
-
QTBUG-134668 As a dev, I need a simple way to add a Qt Quick UI to my Python code
-
- In Progress
-
For Gerrit Dashboard: QTBUG-134685 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
674099,3 | Refactor AutoQmlBridge to use shared_ptr for bridge and model storage | dev | qt/tqtc-qtbridges | Status: NEW | 0 | 0 |
648390,14 | Python: Add QtBridges Python package | dev | qt/tqtc-qtbridges | Status: MERGED | +2 | 0 |
650392,15 | Python: Add function AutoQmlBridge | dev | qt/tqtc-qtbridges | Status: MERGED | +2 | 0 |
651460,9 | Python: Add type hints for AutoQmlBridge() | dev | qt/tqtc-qtbridges | Status: MERGED | +2 | 0 |
652269,10 | Python: Initialize MetaObjectBuilder | dev | qt/tqtc-qtbridges | Status: MERGED | +2 | 0 |