QAbstractTableModel Class
The QAbstractTableModel class provides an abstract model that can be subclassed to create table models. More…
| Header | #include <QAbstractTableModel> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Inherits | QAbstractItemModel |
| Inherited by | QSqlQueryModel |
List of all members, including inherited members
Public Functions
| QAbstractTableModel(QObject *parent = nullptr) | |
| ~QAbstractTableModel() |
Reimplemented Public Functions
| QModelIndex | index(int row, int column, const QModelIndex &parent = QModelIndex()) const |
| QModelIndex | sibling(int row, int column, const QModelIndex &idx) const |
| bool | dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
| Qt::ItemFlags | flags(const QModelIndex &index) const |
Detailed Description
A table model has rows and columns but no child items. Subclasses implement rowCount(), columnCount() and data(); index() and parent() are provided.
See also QAbstractListModel and QAbstractItemModel.
Differences from Qt
None.
Member Function Documentation
QAbstractTableModel::QAbstractTableModel(QObject *parent = nullptr)
Constructs a table model with the given parent.
QAbstractTableModel::~QAbstractTableModel()
Destroys the table model.
bool QAbstractTableModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Reimplements QAbstractItemModel::dropMimeData().
Drops data with action at row and column under parent.
Qt::ItemFlags QAbstractTableModel::flags(const QModelIndex &index) const
Reimplements QAbstractItemModel::flags().
Returns the flags of the item at index, with Qt::ItemNeverHasChildren.
QModelIndex QAbstractTableModel::index(int row, int column, const QModelIndex &parent = QModelIndex()) const
Reimplements QAbstractItemModel::index().
Returns the index at row and column, or an invalid index if it is out of range or parent is valid.
QModelIndex QAbstractTableModel::sibling(int row, int column, const QModelIndex &idx) const
Reimplements QAbstractItemModel::sibling().
Returns the index at row and column next to idx.