QAbstractItemModel is a class in the Qt framework. It provides the abstract interface for item model classes.
The QAbstractItemModel
class defines the standard interface that item models must use to be able to interoperate with other components in the model/view architecture. It is not supposed to be instantiated directly, but rather it should be subclassed in order to create new models.
The QAbstractItemModel class is one of the Model/View Classes and is part of Qt's model/view framework. It can be used as the underlying data model for the item view elements in QML or the item view classes in the Qt Widgets module.
When subclassing QAbstractItemModel
, at the very least you must implement index()
, parent()
, rowCount()
, columnCount()
, and data()
. These functions are used in all read-only models, and form the basis of editable models.
The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.