How to get set model correctly
-
Hello people!
I have a QAbstractTableModel class, a delegate class, QListView and QTable view.
in the model class (which inherits the QAbstractTableModel) I have a Qlist of data object.
in the delegate class I paint it for the view, so in the view part I do the following
listView->setmodel(model);
tableView->setModel(model);listView->setItemDelegate(delegate);
tableView->setItemDelegate(delegate);and the output for the list View is exactly what I want, rows painted by the delegates, but for the table view I have the same number of row as in the list and the columns also but all items in a row has the same value, I don't guess why
can you answer me please? -
Eh? You only want to show a subset of the data that is visible in the table view in the list view? That is: the list should have fewer rows than the table?
If so, you cannot use the (exact) same model. You might be able to use a proxy model to filer your base model back to the rows you want to show in the list though.