A map of QStandardItemModel or QTablView
-
i want to store tableviews in a map which way is better to keep all the information about the table
like (rowcounts,values in the cells,h/v headerlabels,.....)
should i do this
@QMap<QString,QStandardItemModel*> tables;@
or
@QMap<QString,QTableView*> tables;@
or
maybe a whole other way -
The table information should be within your model, not your view. Your view is just a "dumb" view widget that doesn't hold the represented data itself. However if you have multiple views that work differently (on the same model?) you could use the qmap<QString, QTableView*>. On the other hand, what does the QString hold? Isn't a simple QList<QTableView> not more easy?