Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
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) } } } }
Attachments
Issue Links
- 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
-