I want to make a QTreeView that shows some data that I get with sqlalchemy. There are about 1000-10.000 rows to show. I thought that a using a model would be better to use here than the simpler QTreeWidget, because I thought it would be relatively easy to connect the model to sqlalchemy, because I assumed that this is something that is done quite often. Apparently it is not... I am unable to find good examples of this.
I looked at the documentation of QStandardItemModel, and as I understood it, I have to create a QStandardItem for every value. With thousands of rows times nine columns, I think that this is going to be terribly slow.
I have worked with ObjectListView in wxpython before and hoped the treeview in Qt would work similar, so you can imagine my disappointment when I found how complex this was going to be :P.
So my questions:
- Is there a way to connect sqlalchemy to the QTreeView?
- How can I use the items that are returned by sqlaclhemy in my treeview? (like done by ObjectListView)
As you can see I am very new to models and views (and Qt), so any answer, explanation, link, usefull hint or whatsever that has something to say about this is very welcome!