0

I am writing a program in Qt creator. I have a treeview and a tableview. Each time an item in the treeview is clicked, I need to update the tableview. The problem is that the tables realted to each tree item is different. Since the tableview works with SQLite databases, I have decided to create a database and a qsqltablemodel for each of the tree items and set the qsqltablemodel for the tableview upon each click on the tree item. I guess the tableview should update then. To implement this, I need at least 60 databases and models and am thinking if there is any issue with having mutiple databases and how to manage them effectively.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
  • With `qsqltablemodel` you set your model for one single table records .. the problem is in your solution and you need more reading for Qt QSqL .. – Mohammad Kanan Sep 18 '21 at 22:41
  • The problem is that no document has explained why having several models with their associated sql library in a single program is problematic. So, I really do not know how to update the table view in my program for various data sets. – TheWhiteHorse Sep 20 '21 at 16:02
  • _having several models with their associated sql library in a single program is problematic_ .. Not true , nobody said that! you need to implement different model for each table .. you cant have same logical model for different tables – Mohammad Kanan Sep 20 '21 at 18:29

0 Answers0