Hello,
i have problem with make tree model from flat sql data (by parent_id), i dont find simple example.
I must use proxy model ? Or its any new feautures for QSqlQueryModel ?
thx for help
Hello,
i have problem with make tree model from flat sql data (by parent_id), i dont find simple example.
I must use proxy model ? Or its any new feautures for QSqlQueryModel ?
thx for help
You have to implement a proxy model. It's not that hard (although not trivial in this particular case), believe me.
I have the code that does something like that but I can't show it to youI can give you a hint though. Think how to map indexes between a flat model and a hierarchical one. Write down the solution on a piece of paper and then implement mapFromIndex() and mapToIndex() according to your notes. The rest should be easy.
Bookmarks