mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 12:24:16 +00:00
Python: Improve Struct mapping
When reading, create the local equivalent of a dataclass, so that access doesn't require ["foo"] key syntax. Also implement the copy protocol, so that we can safely make clones of the references returned by the ListModel.
This commit is contained in:
parent
0b6381d012
commit
e3aab79fdb
7 changed files with 103 additions and 25 deletions
|
|
@ -41,6 +41,7 @@ fn slint(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
|
|||
m.add_class::<brush::PyColor>()?;
|
||||
m.add_class::<brush::PyBrush>()?;
|
||||
m.add_class::<models::PyModelBase>()?;
|
||||
m.add_class::<value::PyStruct>()?;
|
||||
m.add_function(wrap_pyfunction!(run_event_loop, m)?)?;
|
||||
m.add_function(wrap_pyfunction!(quit_event_loop, m)?)?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue