December 7, 2011

toho71 toho71
Lab Rat
189 posts

[Solved]QStandardItemModel

 

When I use this and shows the values in a QTableview it works fine BUT
I uses five views in diffrent tabs and only want to show parts of the QSIM in the diffrent views.

In the first view I got 3 rows and thats OK.
In the second view I got 7 rows with values but I also got 3 empty Rows.

And the next view I got 15 rows with values and 10 empty rows.

It look likes the empty rows is the ones where i dont choose to show the values.

Could i somhowe update the view or something.
I dont want to have diffrent QSIM:s for each view.

//T

2 replies

December 7, 2011

Andre Andre
Area 51 Engineer
6031 posts

It is hard to tell you what you are doing wrong without seeing any code, but my guess is that you are manipulating the model itself somehow for the different tabs?

What you should do if you want to share a common model between the views, but have the views show different selections from the model, is to use a QSortFilterProxyModel between your QStandardItemModel and each of your views. So, you end up with as many QSFPM instances as you have views, but all of them operate on the same underlying model.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

December 7, 2011

toho71 toho71
Lab Rat
189 posts

Yes thats the answer.
thanks

 
  ‹‹ Re: QGraphicsItemAnimation      How to paste system clipboard content to outside of Qt app ››

You must log in to post a reply. Not a member yet? Register here!