Model based vs Item based
-
wrote on 13 Feb 2017, 13:07 last edited by
Hi,
i need a tree widget to display some text (similar to the registry tree). The text should be selectable and i'd like to have right klick support. So if i do a right klick there appears a little context menu.
I saw two different version in the designer:
- model based
- item based
What is the differences and which should i select for my use??
-
wrote on 13 Feb 2017, 13:48 last edited by VRonin
Genesis 1:3
And God said:"Use QAbstractItemModel interface". and QAbstractItemModel interface was used
I'm a bit overly dogmatic here but that's my advice always. The QAbstractItemModel is the one the whole model-view framework relies upon so if you use that interface you are assured it will work regardless of what model and view you use it in. The QStandardItem interface only works with QStandardItemModel (either explicitly or implicitly like in Q[...]Widget classes)
-
Genesis 1:3
And God said:"Use QAbstractItemModel interface". and QAbstractItemModel interface was used
I'm a bit overly dogmatic here but that's my advice always. The QAbstractItemModel is the one the whole model-view framework relies upon so if you use that interface you are assured it will work regardless of what model and view you use it in. The QStandardItem interface only works with QStandardItemModel (either explicitly or implicitly like in Q[...]Widget classes)
wrote on 13 Feb 2017, 15:07 last edited by@VRonin Amen
3/3