Unsolved model/view
-
@raven-worx said in model/view:
If we are not talking about hundreds to thousands you can also use QStandartItems
I actually use tens of thousands tree elements with
QStandartItemModel
and works for me -
@VRonin said in model/view:
I actually use tens of thousands tree elements with QStandartItemModel and works for me
i never said it's not working, but it's a waste of memory.
And thus discouraged to do so (from my side). -
@raven-worx
about your code snippet, what if the row/column values aren't known beforehand? -
@user4592357
then reusing the QHash structure is not ideal, you could use your matrix approach then -
@raven-worx
can't i useQTableWidget
andQTreeWidget
since my models aren't reused? -
@user4592357 That's basically the same as using
QStandartItemModel
that we suggested at the beginning -
@VRonin
how is it the same?should i use the same
QStandartItemModel
for both views? -
I mean
QStandartItemModel
+QTreeView
=QTreeWidget
andQStandartItemModel
+QTableView
=QTableWidget
-
@VRonin @raven-worx
i have another question.so my table widget consists of 2 widgets:
QTableView
and aQTextEdit
under it to display info about a particular cell.the data container i use to set model data consists of two maps:
- data storage for table view
- data storage for text edit
how should i handle this in
data()
? -
should i user two different containers???