I want to store custom data using a model. For that , am a bit confused as which item model to choose for subclassing. I need some clarification as, which is the best model to subclassing ? And also i need the advantages of QAbstractItemModel over QStandardItemModel ?
Thanks!
It depends on your needs.
Use QStandardItemModel
if you just want to store custom data and don't want to write your own model logic. This one is generic, you can use it for custom data without subclassing.
On the other way, if you wish to write your own model logic, then choose QAbstractItemModel
. It is abstract class. It means, it has no behavior implemented, it is just an 'interface'. It tells you which methods your model should implement, so it can be used as ano other ItemModel class in Qt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With