QAbstractItemModel Class
The QAbstractItemModel class provides the abstract interface for item model classes. More…
| Header | #include <QAbstractItemModel> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Core) |
| Module | Nt Core C++ Classes |
| Inherits | QObject |
| Inherited by | QAbstractListModel, QAbstractProxyModel, QAbstractTableModel, QConcatenateTablesProxyModel |
List of all members, including inherited members
Public Types
| enum | LayoutChangeHint |
| enum | CheckIndexOption |
| typedef | CheckIndexOptions |
Public Functions
| QAbstractItemModel(QObject *parent = nullptr) | |
| ~QAbstractItemModel() | |
| bool | hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const |
| virtual QModelIndex | index(int row, int column, const QModelIndex &parent = QModelIndex()) const |
| virtual QModelIndex | parent(const QModelIndex &child) const |
| virtual QModelIndex | sibling(int row, int column, const QModelIndex &idx) const |
| virtual int | rowCount(const QModelIndex &parent = QModelIndex()) const |
| virtual int | columnCount(const QModelIndex &parent = QModelIndex()) const |
| virtual bool | hasChildren(const QModelIndex &parent = QModelIndex()) const |
| virtual QVariant | data(const QModelIndex &index, int role = Qt::DisplayRole) const |
| virtual bool | setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) |
| virtual QVariant | headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const |
| virtual bool | setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) |
| virtual QMap<int, QVariant> | itemData(const QModelIndex &index) const |
| virtual bool | setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles) |
| virtual bool | clearItemData(const QModelIndex &index) |
| virtual QStringList | mimeTypes() const |
| virtual QMimeData * | mimeData(const QModelIndexList &indexes) const |
| virtual bool | canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const |
| virtual bool | dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
| virtual Qt::DropActions | supportedDropActions() const |
| virtual Qt::DropActions | supportedDragActions() const |
| virtual bool | insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) |
| virtual bool | insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()) |
| virtual bool | removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) |
| virtual bool | removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()) |
| virtual bool | moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) |
| virtual bool | moveColumns(const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild) |
| bool | insertRow(int row, const QModelIndex &parent = QModelIndex()) |
| bool | insertColumn(int column, const QModelIndex &parent = QModelIndex()) |
| bool | removeRow(int row, const QModelIndex &parent = QModelIndex()) |
| bool | removeColumn(int column, const QModelIndex &parent = QModelIndex()) |
| bool | moveRow(const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild) |
| bool | moveColumn(const QModelIndex &sourceParent, int sourceColumn, const QModelIndex &destinationParent, int destinationChild) |
| virtual void | fetchMore(const QModelIndex &parent) |
| virtual bool | canFetchMore(const QModelIndex &parent) const |
| virtual Qt::ItemFlags | flags(const QModelIndex &index) const |
| virtual void | sort(int column, Qt::SortOrder order = Qt::AscendingOrder) |
| virtual QModelIndex | buddy(const QModelIndex &index) const |
| virtual QModelIndexList | match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const |
| virtual QSize | span(const QModelIndex &index) const |
| virtual QHash<int, QByteArray> | roleNames() const |
| bool | checkIndex(const QModelIndex &index, CheckIndexOptions options = CheckIndexOption::NoOption) const |
Public Slots
Signals
| void | dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &roles = QList<int>()) |
| void | headerDataChanged(Qt::Orientation orientation, int first, int last) |
| void | layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint) |
| void | layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint) |
| void | rowsAboutToBeInserted(const QModelIndex &parent, int first, int last) |
| void | rowsInserted(const QModelIndex &parent, int first, int last) |
| void | rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last) |
| void | rowsRemoved(const QModelIndex &parent, int first, int last) |
| void | columnsAboutToBeInserted(const QModelIndex &parent, int first, int last) |
| void | columnsInserted(const QModelIndex &parent, int first, int last) |
| void | columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last) |
| void | columnsRemoved(const QModelIndex &parent, int first, int last) |
| void | modelAboutToBeReset() |
| void | modelReset() |
| void | rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow) |
| void | rowsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row) |
| void | columnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn) |
| void | columnsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column) |
Protected Functions
| QModelIndex | createIndex(int row, int column, const void *ptr = nullptr) const |
| QModelIndex | createIndex(int row, int column, quintptr id) const |
| void | beginInsertRows(const QModelIndex &parent, int first, int last) |
| void | endInsertRows() |
| void | beginRemoveRows(const QModelIndex &parent, int first, int last) |
| void | endRemoveRows() |
| bool | beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow) |
| void | endMoveRows() |
| void | beginInsertColumns(const QModelIndex &parent, int first, int last) |
| void | endInsertColumns() |
| void | beginRemoveColumns(const QModelIndex &parent, int first, int last) |
| void | endRemoveColumns() |
| bool | beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn) |
| void | endMoveColumns() |
| void | beginResetModel() |
| void | endResetModel() |
| void | changePersistentIndex(const QModelIndex &from, const QModelIndex &to) |
| void | changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to) |
| QModelIndexList | persistentIndexList() const |
Protected Slots
| virtual void | resetInternalData() |
Detailed Description
An item model presents data as a table of items, where each item can have a table of child items. Subclasses implement index(), parent(), rowCount(), columnCount() and data(); editable models also implement setData() and flags(), and resizable models insertRows() and removeRows().
Changes are announced with the begin and end functions, such as beginInsertRows() and endInsertRows(), which emit the matching signals and keep persistent indexes up to date:
bool MyModel::insertRows(int row, int count, const QModelIndex &parent)
{
beginInsertRows(parent, row, row + count - 1);
m_items.insert(row, count, QString());
endInsertRows();
return true;
}
See also QModelIndex, QAbstractListModel, QAbstractTableModel and QSortFilterProxyModel.
Differences from Qt
The signals are ordinary public signals, without Qt's QPrivateSignal argument. There is no multiData(), encodeData() or decodeData(); the default mimeData() and dropMimeData() use their own encoding of the item data under the Qt MIME type. Item data in that encoding is limited to the types that QDataStream can store in a QVariant.
Member Type Documentation
enum QAbstractItemModel::CheckIndexOption
| Constant | Description |
|---|---|
QAbstractItemModel::NoOption | No check option is set. |
QAbstractItemModel::IndexIsValid | The index must be valid. |
QAbstractItemModel::DoNotUseParent | The parent of the index is not checked. |
QAbstractItemModel::ParentIsInvalid | The parent of the index must be invalid: the index is at the top level. |
This function was introduced in 5.11.
typedef QAbstractItemModel::CheckIndexOptions
The CheckIndexOptions type is a typedef for QFlags<CheckIndexOption>. It stores an OR combination of CheckIndexOption values.
enum QAbstractItemModel::LayoutChangeHint
| Constant | Description |
|---|---|
QAbstractItemModel::NoLayoutChangeHint | No hint is available. |
QAbstractItemModel::VerticalSortHint | Rows are being sorted. |
QAbstractItemModel::HorizontalSortHint | Columns are being sorted. |
Member Function Documentation
QAbstractItemModel::QAbstractItemModel(QObject *parent = nullptr)
Constructs an item model with the given parent.
QAbstractItemModel::~QAbstractItemModel()
Destroys the model. Persistent indexes of the model become invalid.
void QAbstractItemModel::beginInsertColumns(const QModelIndex &parent, int first, int last)
Begins inserting columns first to last under parent: emits columnsAboutToBeInserted(). Call endInsertColumns() afterwards.
void QAbstractItemModel::beginInsertRows(const QModelIndex &parent, int first, int last)
Begins inserting rows first to last under parent: emits rowsAboutToBeInserted(). Call endInsertRows() after inserting the rows.
bool QAbstractItemModel::beginMoveColumns(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn)
Begins moving columns sourceFirst to sourceLast under sourceParent to before column destinationColumn under destinationParent, and emits columnsAboutToBeMoved(). Returns false, doing nothing, if the move is not possible; otherwise call endMoveColumns() afterwards.
bool QAbstractItemModel::beginMoveRows(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow)
Begins moving rows sourceFirst to sourceLast under sourceParent to before row destinationRow under destinationParent, and emits rowsAboutToBeMoved(). Returns false, doing nothing, if the move is not possible (the destination is inside the moved rows, or the move would not change anything); otherwise call endMoveRows() after moving the rows.
void QAbstractItemModel::beginRemoveColumns(const QModelIndex &parent, int first, int last)
Begins removing columns first to last under parent: emits columnsAboutToBeRemoved(). Call endRemoveColumns() afterwards.
void QAbstractItemModel::beginRemoveRows(const QModelIndex &parent, int first, int last)
Begins removing rows first to last under parent: emits rowsAboutToBeRemoved(). Call endRemoveRows() after removing the rows.
void QAbstractItemModel::beginResetModel()
Begins resetting the model: emits modelAboutToBeReset(). Call endResetModel() after changing the data.
QModelIndex QAbstractItemModel::buddy(const QModelIndex &index) const
Returns the item that is edited in place of the item at index; the default returns index.
bool QAbstractItemModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
Returns true if data can be dropped with action at row and column under parent; otherwise returns false. The default checks the format and the action.
bool QAbstractItemModel::canFetchMore(const QModelIndex &parent) const
Returns true if more items can be fetched under parent; the default returns false.
void QAbstractItemModel::changePersistentIndex(const QModelIndex &from, const QModelIndex &to)
Changes the persistent indexes that refer to from so that they refer to to. An invalid to invalidates them. Models call this between layoutAboutToBeChanged() and layoutChanged().
void QAbstractItemModel::changePersistentIndexList(const QModelIndexList &from, const QModelIndexList &to)
Changes the persistent indexes that refer to the indexes in from to the corresponding indexes in to.
This function was introduced in 4.1.
bool QAbstractItemModel::checkIndex(const QModelIndex &index, CheckIndexOptions options = CheckIndexOption::NoOption) const
Returns true if index is a valid index of this model, checked according to options; otherwise prints a warning and returns false. An invalid index passes unless IndexIsValid is set.
This function was introduced in 5.11.
bool QAbstractItemModel::clearItemData(const QModelIndex &index)
Removes the data of all roles of the item at index and returns true on success. The default returns false.
This function was introduced in 6.0.
int QAbstractItemModel::columnCount(const QModelIndex &parent = QModelIndex()) const
Returns the number of columns under parent.
void QAbstractItemModel::columnsAboutToBeInserted(const QModelIndex &parent, int first, int last)
This signal is emitted before columns first to last are inserted under parent.
void QAbstractItemModel::columnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
This signal is emitted before columns sourceStart to sourceEnd under sourceParent move to before column destinationColumn under destinationParent.
void QAbstractItemModel::columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted before columns first to last are removed from under parent.
void QAbstractItemModel::columnsInserted(const QModelIndex &parent, int first, int last)
This signal is emitted after columns first to last were inserted under parent.
void QAbstractItemModel::columnsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column)
This signal is emitted after columns start to end under parent moved to before column column under destination.
void QAbstractItemModel::columnsRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted after columns first to last were removed from under parent.
QModelIndex QAbstractItemModel::createIndex(int row, int column, const void *ptr = nullptr) const
Creates an index of this model for row and column that stores the pointer ptr.
QModelIndex QAbstractItemModel::createIndex(int row, int column, quintptr id) const
This is an overloaded function.
Creates an index of this model for row and column that stores the integer id.
QVariant QAbstractItemModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const
Returns the data of the item at index for role, or an invalid QVariant.
See also setData() and Qt::ItemDataRole.
void QAbstractItemModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &roles = QList<int>())
This signal is emitted when the data of the items from topLeft to bottomRight changes. roles lists the roles that changed; an empty list means all of them.
bool QAbstractItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Inserts the items in data, dropped with action, at row and column under parent and returns true on success. The default understands the format of mimeData(): it inserts rows and sets the item data.
void QAbstractItemModel::endInsertColumns()
Ends inserting columns: updates persistent indexes and emits columnsInserted().
void QAbstractItemModel::endInsertRows()
Ends inserting rows: updates persistent indexes and emits rowsInserted().
void QAbstractItemModel::endMoveColumns()
Ends moving columns: updates persistent indexes and emits columnsMoved().
void QAbstractItemModel::endMoveRows()
Ends moving rows: updates persistent indexes and emits rowsMoved().
void QAbstractItemModel::endRemoveColumns()
Ends removing columns: invalidates or updates persistent indexes and emits columnsRemoved().
void QAbstractItemModel::endRemoveRows()
Ends removing rows: invalidates the persistent indexes of removed items, updates the others and emits rowsRemoved().
void QAbstractItemModel::endResetModel()
Ends resetting the model: invalidates all persistent indexes, calls resetInternalData() and emits modelReset().
void QAbstractItemModel::fetchMore(const QModelIndex &parent)
Fetches more items under parent, for models that load data incrementally. The default does nothing.
Qt::ItemFlags QAbstractItemModel::flags(const QModelIndex &index) const
Returns the flags of the item at index: Qt::ItemIsSelectable and Qt::ItemIsEnabled for a valid index, and none for an invalid one.
bool QAbstractItemModel::hasChildren(const QModelIndex &parent = QModelIndex()) const
Returns true if parent has child items; otherwise returns false. The default asks rowCount() and columnCount().
bool QAbstractItemModel::hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const
Returns true if row and column are inside the table under parent; otherwise returns false.
QVariant QAbstractItemModel::headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const
Returns the header data of section in orientation for role. The default returns the section number counted from 1 for Qt::DisplayRole.
void QAbstractItemModel::headerDataChanged(Qt::Orientation orientation, int first, int last)
This signal is emitted when the header sections first to last of orientation change.
QModelIndex QAbstractItemModel::index(int row, int column, const QModelIndex &parent = QModelIndex()) const
Returns the index of the item at row and column under parent. Subclasses implement it with createIndex().
See also parent() and createIndex().
bool QAbstractItemModel::insertColumn(int column, const QModelIndex &parent = QModelIndex())
Inserts one column before column under parent.
bool QAbstractItemModel::insertColumns(int column, int count, const QModelIndex &parent = QModelIndex())
Inserts count columns before column under parent and returns true on success. The default returns false.
bool QAbstractItemModel::insertRow(int row, const QModelIndex &parent = QModelIndex())
Inserts one row before row under parent.
bool QAbstractItemModel::insertRows(int row, int count, const QModelIndex &parent = QModelIndex())
Inserts count rows before row under parent and returns true on success. The default returns false; resizable models implement it with beginInsertRows() and endInsertRows().
QMap<int, QVariant> QAbstractItemModel::itemData(const QModelIndex &index) const
Returns the data of the item at index for all predefined roles that have data.
void QAbstractItemModel::layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint)
This signal is emitted before the items under parents (all items if empty) are rearranged; hint describes how.
void QAbstractItemModel::layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint)
This signal is emitted after the items under parents (all items if empty) were rearranged; hint describes how.
See also layoutAboutToBeChanged().
QModelIndexList QAbstractItemModel::match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const
Returns up to hits indexes of items in the column of start, under its parent and starting at its row, whose data for role matches value according to flags. A hits of -1 returns all matches. With Qt::MatchWrap the search wraps to the first row, and with Qt::MatchRecursive child items are searched too.
QMimeData * QAbstractItemModel::mimeData(const QModelIndexList &indexes) const
Returns a new QMimeData object with the data of the items at indexes, or nullptr if indexes is empty. The caller owns the object.
QStringList QAbstractItemModel::mimeTypes() const
Returns the MIME types that mimeData() produces; the default is the Qt item list type application/x-qabstractitemmodeldatalist.
void QAbstractItemModel::modelAboutToBeReset()
This signal is emitted when the model is about to be reset.
void QAbstractItemModel::modelReset()
This signal is emitted after the model was reset.
bool QAbstractItemModel::moveColumn(const QModelIndex &sourceParent, int sourceColumn, const QModelIndex &destinationParent, int destinationChild)
Moves the column sourceColumn under sourceParent to before destinationChild under destinationParent.
This function was introduced in 5.11.
bool QAbstractItemModel::moveColumns(const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild)
Moves count columns from sourceColumn under sourceParent to before destinationChild under destinationParent and returns true on success. The default returns false.
This function was introduced in 5.11.
bool QAbstractItemModel::moveRow(const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild)
Moves the row sourceRow under sourceParent to before destinationChild under destinationParent.
This function was introduced in 5.11.
bool QAbstractItemModel::moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
Moves count rows from sourceRow under sourceParent to before destinationChild under destinationParent and returns true on success. The default returns false.
This function was introduced in 5.11.
QModelIndex QAbstractItemModel::parent(const QModelIndex &child) const
Returns the parent of the item at child, or an invalid index for a top-level item.
QModelIndexList QAbstractItemModel::persistentIndexList() const
Returns the indexes currently held by persistent indexes of the model.
This function was introduced in 4.2.
bool QAbstractItemModel::removeColumn(int column, const QModelIndex &parent = QModelIndex())
Removes the column column under parent.
bool QAbstractItemModel::removeColumns(int column, int count, const QModelIndex &parent = QModelIndex())
Removes count columns from column under parent and returns true on success. The default returns false.
bool QAbstractItemModel::removeRow(int row, const QModelIndex &parent = QModelIndex())
Removes the row row under parent.
bool QAbstractItemModel::removeRows(int row, int count, const QModelIndex &parent = QModelIndex())
Removes count rows from row under parent and returns true on success. The default returns false.
void QAbstractItemModel::resetInternalData()
Called when the model is reset, after modelAboutToBeReset() and before modelReset(), so that subclasses can clear their internal data. The default does nothing.
This function was introduced in 5.0.
void QAbstractItemModel::revert()
Lets the model discard cached changes. The default does nothing.
QHash<int, QByteArray> QAbstractItemModel::roleNames() const
Returns the names of the roles, as used by declarative frontends. The defaults are "display", "decoration", "edit", "toolTip", "statusTip" and "whatsThis".
This function was introduced in 4.6.
int QAbstractItemModel::rowCount(const QModelIndex &parent = QModelIndex()) const
Returns the number of rows under parent.
void QAbstractItemModel::rowsAboutToBeInserted(const QModelIndex &parent, int first, int last)
This signal is emitted before rows first to last are inserted under parent.
void QAbstractItemModel::rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
This signal is emitted before rows sourceStart to sourceEnd under sourceParent move to before row destinationRow under destinationParent.
void QAbstractItemModel::rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted before rows first to last are removed from under parent.
void QAbstractItemModel::rowsInserted(const QModelIndex &parent, int first, int last)
This signal is emitted after rows first to last were inserted under parent.
void QAbstractItemModel::rowsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row)
This signal is emitted after rows start to end under parent moved to before row row under destination.
void QAbstractItemModel::rowsRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted after rows first to last were removed from under parent.
bool QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole)
Sets the data of the item at index for role to value and returns true on success. The default does nothing and returns false; editable models emit dataChanged() when they change data.
bool QAbstractItemModel::setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole)
Sets the header data of section in orientation for role to value and returns true on success. The default returns false.
bool QAbstractItemModel::setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles)
Sets the data of the item at index for each role in roles and returns true if all of them succeeded.
QModelIndex QAbstractItemModel::sibling(int row, int column, const QModelIndex &idx) const
Returns the index at row and column under the parent of idx.
void QAbstractItemModel::sort(int column, Qt::SortOrder order = Qt::AscendingOrder)
Sorts the model by column in order. The default does nothing.
QSize QAbstractItemModel::span(const QModelIndex &index) const
Returns the number of rows and columns the item at index spans; the default is one of each.
bool QAbstractItemModel::submit()
Lets the model write cached changes to its storage and returns true on success. The default returns true.
Qt::DropActions QAbstractItemModel::supportedDragActions() const
Returns the drag actions the model supports; the default is supportedDropActions().
Qt::DropActions QAbstractItemModel::supportedDropActions() const
Returns the drop actions the model supports; the default is Qt::CopyAction.