I have some newbie question. I'm not sure if I understand Model-View-Controller design pattern correctly.
Maybe I will start from describing my problem. I'm reading some data from file. This can take let's say 10 seconds and after that I present those data in the table. The question is how should I store those data? Besides QStandardItemModel
should I have another container to which I will read data from file and use it in other threads? For example, I have QStandardItemModel
in Gui thread and I create another container let's say QVector
. I load data from file to QVector
and then I move data from QVector
to QStandardItemModel
?
I can't use QStandardItemModel
in other thread and read data directly from file to QStandardItemModel
because GUI freeze as I know because QStandardItemModel
emits signal to update view after appendRow
.
Or maybe I should create custom model and add method to update view only when whole file is loaded into QStandardItemModel
? QTableView
has own container for data and it's not synchronized with the model? Is it possible/correct way?
What with situation when I read a new file?
Thanks for any help.