Hi,
I am currently set ModelA to a view. On clicking a button, I want to toggle between model B and model A in the same view. (The columns remain the same, the number of rows and the data is entirely different).
Both models are of the QStandardItemModel type.
Is there a better and faster way to have the switch other than using view->setmodel every time?
I tried setting a fixed 'mainmodel', which is always set to the view. Then I tried assigning the mainmodel to modelb or modelA and tried to see if these changes reflect instantaneously.
But this did not work, the view did not update on simple assignment.
Can someone please guide me to how this is usually done?
Thanks,
Padma
Bookmarks