🙋🏼♂️
Does anyone have a Pyside2 of QML ListView with backend model?
I've found this, but it seems to be outdated
https://wiki.qt.io/Selectable-list-of-Python-objects-in-QML
20 May 2020
Ссылка
click to show
click to show
i have some models here https://github.com/jgirardet/MyCartable/blob/dev/src/python/package/page/page_model.py and here https://github.com/jgirardet/MyCartable/blob/dev/src/python/package/operations/models.py but i'm not sure if its the right way to do things
Ссылка
click to show
click to show
the you call qmlregistertype to add it to qml engine : https://github.com/jgirardet/MyCartable/blob/dev/src/python/main.py
Nice, thanks!
After more thorough lookup I also found this:
https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/declarative/usingmodel.py
Jim @yossiovcharik do you feel like writing an example or tutorial for the documentation? maybe even submitting some files of an example case would be really good, since many people is using QML
Cristián 🥑Jim @yossiovcharik do you feel like writing an example or tutorial for the documentation? maybe even submitting some files of an example case would be really good, since many people is using QML
Ссылка
click to show
click to show
Like this one https://t.me/qtforpython/1897 but updated for PySide2 ?
Maybe I could :)
Never done that, but I'd like to contribute
Could you please point me to a guideline/tutorial for tutorial creation?
Ссылка
click to show
click to show
why not for another example but i did it monthes ago and it seems it has'nt been reviewed yet ;-) https://codereview.qt-project.org/c/pyside/pyside-setup/+/288259
@cmaureir
1. What branch should tutorials etc. should be on?
2. Where in the repo they should be?
I mean a tutorial like the one I mentioned above, with description etc.
Not like these in pyside/examples/tutorial/
1. if you believe you can have it ready these days (say it's submitted before Monday) -> 5.15 since the release will be on the 26th of this month.
2. If you want to write a Tutorial, with text and more, sources/pyside2/doc/tutorials/ inside there you need to create a directory (you can just copy other there and replace the text and stuff), if you want to just submit the code as an example: examples/declarative/
both. I use context properties as singleton (for example to interface database/api ) and qmlRegisterType for QAbstractlistModel derived class. It's pretty usable except for testing but it'sanother question :-) I declare all in a main.py file. I also add an instance of context_property to app (QApplication) so I can access it every where without importing (jsut retrieving app via QApplication.instance() and use app.ddb.myslot()