Tree of Items served by QAbstractItemModel derived class and keeping it in SQLite database. How to?
-
I need to keep whole Tree of items in persistant storage SQLite database.
Shall I use QSqlQueryModel? Is that best way to sync data of treeStructure? How to implement this task the best way? -
I need to keep whole Tree of items in persistant storage SQLite database.
Shall I use QSqlQueryModel? Is that best way to sync data of treeStructure? How to implement this task the best way?Look here.
Couple that with the typical child->parent relationship and you can efficiently represent the hierarchical data in SQL database. As for the model, it's just an interface for the view, you should keep your data in your own structure anyway. -
Look here.
Couple that with the typical child->parent relationship and you can efficiently represent the hierarchical data in SQL database. As for the model, it's just an interface for the view, you should keep your data in your own structure anyway.@kshegunov thank you, but there is question of what class sould I use to serve this task. Because serving SQL table manually, by using SQL queries as adding rows, moving rows, etc are very labour-expensive.
Is there a solution for this task? -
@kshegunov thank you, but there is question of what class sould I use to serve this task. Because serving SQL table manually, by using SQL queries as adding rows, moving rows, etc are very labour-expensive.
Is there a solution for this task?@Kofr said in Tree of Items served by QAbstractItemModel derived class and keeping it in SQLite database. How to?:
Is there a solution for this task?
The only solution I know of is to write your own class.