PythonQt.QtCore.QAbstractItemModel · declarations 001
Back to PythonQt.QtCore.QAbstractItemModel
CheckIndexOption
instance-attribute
CheckIndexOption: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
DoNotUseParent
instance-attribute
DoNotUseParent: Any
HorizontalSortHint
instance-attribute
HorizontalSortHint: Any
IndexIsValid
instance-attribute
IndexIsValid: Any
LayoutChangeHint
instance-attribute
LayoutChangeHint: type
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
NoLayoutChangeHint
instance-attribute
NoLayoutChangeHint: Any
NoOption
instance-attribute
NoOption: Any
ParentIsInvalid
instance-attribute
ParentIsInvalid: Any
VerticalSortHint
instance-attribute
VerticalSortHint: Any
beginInsertColumns
beginInsertColumns(parent: Any, first: int, last: int) -> None
X.beginInsertColumns(parent, first, last)
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::beginInsertColumns(const QModelIndex \&parent, int first, int last)
Begins a column insertion operation.
When reimplementing insertColumns() in a subclass, you must call this function before inserting data into the model's underlying data store.
The parent index corresponds to the parent into which the new columns are inserted; first and last are the column numbers of the new columns will have after they have been inserted.
| Inserting columns | Specify the first and last column numbers for the span of columns you want to insert into an item in a model. For example, as shown in the diagram, we insert three columns before column 4, so first is 4 and last is 6: beginInsertColumns(parent, 4, 6); This inserts the three new columns as columns 4, 5, and 6. |
|---|---|
| Appending columns | To append columns, insert them after the last column. For example, as shown in the diagram, we append three columns to a collection of six existing columns (ending in column 5), so first is 6 and last is 8: beginInsertColumns(parent, 6, 8); This appends the two new columns as columns 6, 7, and 8. |
Note: This function emits the columnsAboutToBeInserted() signal which connected views (or proxies) must handle before the data is inserted. Otherwise, the views may end up in an invalid state.
See also endInsertColumns().
Upstream PySide2 reference signatures (binding differences may apply):
beginInsertColumns(self, parent: PySide2.QtCore.QModelIndex, first: int, last: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#beginInsertColumns
beginInsertRows
beginInsertRows(parent: Any, first: int, last: int) -> None
X.beginInsertRows(parent, first, last)
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::beginInsertRows(const QModelIndex \&parent, int first, int last)
Begins a row insertion operation.
When reimplementing insertRows() in a subclass, you must call this function before inserting data into the model's underlying data store.
The parent index corresponds to the parent into which the new rows are inserted; first and last are the row numbers that the new rows will have after they have been inserted.
| Inserting rows | Specify the first and last row numbers for the span of rows you want to insert into an item in a model. For example, as shown in the diagram, we insert three rows before row 2, so first is 2 and last is 4: beginInsertRows(parent, 2, 4); This inserts the three new rows as rows 2, 3, and 4. |
|---|---|
| Appending rows | To append rows, insert them after the last row. For example, as shown in the diagram, we append two rows to a collection of 4 existing rows (ending in row 3), so first is 4 and last is 5: beginInsertRows(parent, 4, 5); This appends the two new rows as rows 4 and 5. |
Note: This function emits the rowsAboutToBeInserted() signal which connected views (or proxies) must handle before the data is inserted. Otherwise, the views may end up in an invalid state.
See also endInsertRows().
Upstream PySide2 reference signatures (binding differences may apply):
beginInsertRows(self, parent: PySide2.QtCore.QModelIndex, first: int, last: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#beginInsertRows
beginMoveColumns
beginMoveColumns(sourceParent: Any, sourceFirst: int, sourceLast: int, destinationParent: Any, destinationColumn: int) -> bool
X.beginMoveColumns(sourceParent, sourceFirst, sourceLast, destinationParent, destinationColumn) -> bool
Supplemental documentation: Qt 5 reference:
[protected] bool QAbstractItemModel::beginMoveColumns(const QModelIndex \&sourceParent, int sourceFirst, int sourceLast, const QModelIndex \&destinationParent, int destinationChild)
Begins a column move operation.
When reimplementing a subclass, this method simplifies moving entities in your model. This method is responsible for moving persistent indexes in the model, which you would otherwise be required to do yourself. Using beginMoveColumns and endMoveColumns is an alternative to emitting layoutAboutToBeChanged and layoutChanged directly along with changePersistentIndex.
The sourceParent index corresponds to the parent from which the columns are moved; sourceFirst and sourceLast are the first and last column numbers of the columns to be moved. The destinationParent index corresponds to the parent into which those columns are moved. The destinationChild is the column to which the columns will be moved. That is, the index at column sourceFirst in sourceParent will become column destinationChild in destinationParent, followed by all other columns up to sourceLast.
However, when moving columns down in the same parent (sourceParent and
destinationParent are equal), the columns will be placed before the destinationChild
index. That is, if you wish to move columns 0 and 1 so they will become columns 1 and 2,
destinationChild should be 3. In this case, the new index for the source column i
(which is between sourceFirst and sourceLast) is equal to
(destinationChild-sourceLast-1+i).
Note that if sourceParent and destinationParent are the same, you must ensure that
the destinationChild is not within the range of sourceFirst and sourceLast + 1.
You must also ensure that you do not attempt to move a column to one of its own children
or ancestors. This method returns false if either condition is true, in which case you
should abort your move operation.
This function was introduced in Qt 4.6.
See also endMoveColumns().
Upstream PySide2 reference signatures (binding differences may apply):
beginMoveColumns(self, sourceParent: PySide2.QtCore.QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: PySide2.QtCore.QModelIndex, destinationColumn: int) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#beginMoveColumns
beginMoveRows
beginMoveRows(sourceParent: Any, sourceFirst: int, sourceLast: int, destinationParent: Any, destinationRow: int) -> bool
X.beginMoveRows(sourceParent, sourceFirst, sourceLast, destinationParent, destinationRow) -> bool
Supplemental documentation: Qt 5 reference:
[protected] bool QAbstractItemModel::beginMoveRows(const QModelIndex \&sourceParent, int sourceFirst, int sourceLast, const QModelIndex \&destinationParent, int destinationChild)
Begins a row move operation.
When reimplementing a subclass, this method simplifies moving entities in your model. This method is responsible for moving persistent indexes in the model, which you would otherwise be required to do yourself. Using beginMoveRows and endMoveRows is an alternative to emitting layoutAboutToBeChanged and layoutChanged directly along with changePersistentIndex.
The sourceParent index corresponds to the parent from which the rows are moved; sourceFirst and sourceLast are the first and last row numbers of the rows to be moved. The destinationParent index corresponds to the parent into which those rows are moved. The destinationChild is the row to which the rows will be moved. That is, the index at row sourceFirst in sourceParent will become row destinationChild in destinationParent, followed by all other rows up to sourceLast.
However, when moving rows down in the same parent (sourceParent and
destinationParent are equal), the rows will be placed before the destinationChild
index. That is, if you wish to move rows 0 and 1 so they will become rows 1 and 2,
destinationChild should be 3. In this case, the new index for the source row i
(which is between sourceFirst and sourceLast) is equal to
(destinationChild-sourceLast-1+i).
Note that if sourceParent and destinationParent are the same, you must ensure that
the destinationChild is not within the range of sourceFirst and sourceLast + 1.
You must also ensure that you do not attempt to move a row to one of its own children or
ancestors. This method returns false if either condition is true, in which case you
should abort your move operation.
| Moving rows to another parent | Specify the first and last row numbers for the span of rows in the source parent you want to move in the model. Also specify the row in the destination parent to move the span to. For example, as shown in the diagram, we move three rows from row 2 to 4 in the source, so sourceFirst is 2 and sourceLast is 4. We move those items to above row 2 in the destination, so destinationChild is 2. beginMoveRows(sourceParent, 2, 4, destinationParent, 2); This moves the three rows rows 2, 3, and 4 in the source to become 2, 3 and 4 in the destination. Other affected siblings are displaced accordingly. |
|---|---|
| Moving rows to append to another parent | To append rows to another parent, move them to after the last row. For example, as shown in the diagram, we move three rows to a collection of 6 existing rows (ending in row 5), so destinationChild is 6: beginMoveRows(sourceParent, 2, 4, destinationParent, 6); This moves the target rows to the end of the target parent as 6, 7 and 8. |
| Moving rows in the same parent up | To move rows within the same parent, specify the row to move them to. For example, as shown in the diagram, we move one item from row 2 to row 0, so sourceFirst and sourceLast are 2 and destinationChild is 0. beginMoveRows(parent, 2, 2, parent, 0); Note that other rows may be displaced accordingly. Note also that when moving items within the same parent you should not attempt invalid or no-op moves. In the above example, item 2 is at row 2 before the move, so it cannot be moved to row 2 (where it is already) or row 3 (no-op as row 3 means above row 3, where it is already) |
| Moving rows in the same parent down | To move rows within the same parent, specify the row to move them to. For example, as shown in the diagram, we move one item from row 2 to row 4, so sourceFirst and sourceLast are 2 and destinationChild is 4. beginMoveRows(parent, 2, 2, parent, 4); Note that other rows may be displaced accordingly. |
This function was introduced in Qt 4.6.
See also endMoveRows().
Upstream PySide2 reference signatures (binding differences may apply):
beginMoveRows(self, sourceParent: PySide2.QtCore.QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: PySide2.QtCore.QModelIndex, destinationRow: int) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#beginMoveRows
beginRemoveColumns
beginRemoveColumns(parent: Any, first: int, last: int) -> None
X.beginRemoveColumns(parent, first, last)
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::beginRemoveColumns(const QModelIndex \&parent, int first, int last)
Begins a column removal operation.
When reimplementing removeColumns() in a subclass, you must call this function before removing data from the model's underlying data store.
The parent index corresponds to the parent from which the new columns are removed; first and last are the column numbers of the first and last columns to be removed.
| Removing columns | Specify the first and last column numbers for the span of columns you want to remove from an item in a model. For example, as shown in the diagram, we remove the three columns from column 4 to column 6, so first is 4 and last is 6: beginRemoveColumns(parent, 4, 6); |
|---|---|
Note: This function emits the columnsAboutToBeRemoved() signal which connected views (or proxies) must handle before the data is removed. Otherwise, the views may end up in an invalid state.
See also endRemoveColumns().
Upstream PySide2 reference signatures (binding differences may apply):
beginRemoveColumns(self, parent: PySide2.QtCore.QModelIndex, first: int, last: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#beginRemoveColumns
beginRemoveRows
beginRemoveRows(parent: Any, first: int, last: int) -> None
X.beginRemoveRows(parent, first, last)
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::beginRemoveRows(const QModelIndex \&parent, int first, int last)
Begins a row removal operation.
When reimplementing removeRows() in a subclass, you must call this function before removing data from the model's underlying data store.
The parent index corresponds to the parent from which the new rows are removed; first and last are the row numbers of the rows to be removed.
| Removing rows | Specify the first and last row numbers for the span of rows you want to remove from an item in a model. For example, as shown in the diagram, we remove the two rows from row 2 to row 3, so first is 2 and last is 3: beginRemoveRows(parent, 2, 3); |
|---|---|
Note: This function emits the rowsAboutToBeRemoved() signal which connected views (or proxies) must handle before the data is removed. Otherwise, the views may end up in an invalid state.
See also endRemoveRows().
Upstream PySide2 reference signatures (binding differences may apply):
beginRemoveRows(self, parent: PySide2.QtCore.QModelIndex, first: int, last: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#beginRemoveRows
beginResetModel
beginResetModel() -> None
X.beginResetModel()
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::beginResetModel()
Begins a model reset operation.
A reset operation resets the model to its current state in any attached views.
Note: Any views attached to this model will be reset as well.
When a model is reset it means that any previous data reported from the model is now invalid and has to be queried for again. This also means that the current item and any selected items will become invalid.
When a model radically changes its data it can sometimes be easier to just call this function rather than emit dataChanged() to inform other components when the underlying data source, or its structure, has changed.
You must call this function before resetting any internal data structures in your model or proxy model.
This function emits the signal modelAboutToBeReset().
This function was introduced in Qt 4.6.
See also modelAboutToBeReset(), modelReset(), and endResetModel().
Upstream PySide2 reference signatures (binding differences may apply):
beginResetModel(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#beginResetModel
buddy
buddy(index: Any) -> Any
X.buddy(index) -> PythonQt.QtCore.QModelIndex
Supplemental documentation: Qt 5 reference:
[virtual] QModelIndex QAbstractItemModel::buddy(const QModelIndex \&index) const
Returns a model index for the buddy of the item represented by index. When the user wants to edit an item, the view will call this function to check whether another item in the model should be edited instead. Then, the view will construct a delegate using the model index returned by the buddy item.
The default implementation of this function has each item as its own buddy.
Upstream PySide2 reference signatures (binding differences may apply):
buddy(self, index: PySide2.QtCore.QModelIndex) -> PySide2.QtCore.QModelIndex
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#buddy
canDropMimeData
canDropMimeData(data: Any, action: Any, row: int, column: int, parent: Any) -> bool
X.canDropMimeData(data, action, row, column, parent) -> bool
Supplemental documentation: Qt 5 reference:
[virtual] bool QAbstractItemModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex \&parent) const
Returns true if a model can accept a drop of the data. This default implementation
only checks if data has at least one format in the list of
mimeTypes() and
if action is among the model's
supportedDropActions().
Reimplement this function in your custom model, if you want to test whether the data can be dropped at row, column, parent with action. If you don't need that test, it is not necessary to reimplement this function.
See also dropMimeData() and Using drag and drop with item views.
Upstream PySide2 reference signatures (binding differences may apply):
canDropMimeData(self, data: PySide2.QtCore.QMimeData, action: PySide2.QtCore.Qt.DropAction, row: int, column: int, parent: PySide2.QtCore.QModelIndex) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#canDropMimeData
canFetchMore
canFetchMore(parent: Any) -> bool
X.canFetchMore(parent) -> bool
Supplemental documentation: Qt 5 reference:
[virtual] bool QAbstractItemModel::canFetchMore(const QModelIndex \&parent) const
Returns true if there is more data available for parent; otherwise returns false.
The default implementation always returns false.
If canFetchMore() returns true, the
fetchMore()
function should be called. This is the behavior of
QAbstractItemView, for
example.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also fetchMore().
Upstream PySide2 reference signatures (binding differences may apply):
canFetchMore(self, parent: PySide2.QtCore.QModelIndex) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#canFetchMore
changePersistentIndex
changePersistentIndex(*args: Any, **kwargs: Any) -> None
X.changePersistentIndex(from, to)
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::changePersistentIndex(const QModelIndex \&from, const QModelIndex \&to)
Changes the QPersistentModelIndex that is equal to the given from model index to the given to model index.
If no persistent model index equal to the given from model index was found, nothing is changed.
See also persistentIndexList() and changePersistentIndexList().
Upstream PySide2 reference signatures (binding differences may apply):
changePersistentIndex(self, from_: PySide2.QtCore.QModelIndex, to: PySide2.QtCore.QModelIndex) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#changePersistentIndex
changePersistentIndexList
changePersistentIndexList(*args: Any, **kwargs: Any) -> None
X.changePersistentIndexList(from, to)
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::changePersistentIndexList(const QModelIndexList \&from, const QModelIndexList \&to)
Changes the {QPersistentModelIndex}es that are equal to the indexes in the given from model index list to the given to model index list.
If no persistent model indexes equal to the indexes in the given from model index list are found, nothing is changed.
This function was introduced in Qt 4.1.
See also persistentIndexList() and changePersistentIndex().
Upstream PySide2 reference signatures (binding differences may apply):
changePersistentIndexList(self, from_: typing.List[int], to: typing.List[int]) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#changePersistentIndexList
columnCount
columnCount(parent: Any) -> int
X.columnCount(parent) -> int
Supplemental documentation: Qt 5 reference:
[pure virtual] int QAbstractItemModel::columnCount(const QModelIndex \&parent \= QModelIndex()) const
Returns the number of columns for the children of the given parent.
In most subclasses, the number of columns is independent of the parent.
For example:
int DomModel::columnCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return 3;
}
Note: When implementing a table based model, columnCount() should return 0 when the parent is valid.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also rowCount().
Upstream PySide2 reference signatures (binding differences may apply):
columnCount(self, parent: PySide2.QtCore.QModelIndex=...) -> int
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#columnCount
columnsAboutToBeInserted
columnsAboutToBeInserted(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtCore.QAbstractItemModel.columnsAboutToBeInserted; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QAbstractItemModel::columnsAboutToBeInserted(const QModelIndex \&parent, int first, int last)
This signal is emitted just before columns are inserted into the model. The new items will be positioned between first and last inclusive, under the given parent item.
Note: Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code.
Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.
See also insertColumns() and beginInsertColumns().
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#columnsAboutToBeInserted
columnsAboutToBeMoved
columnsAboutToBeMoved(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtCore.QAbstractItemModel.columnsAboutToBeMoved; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QAbstractItemModel::columnsAboutToBeMoved(const QModelIndex \&sourceParent, int sourceStart, int sourceEnd, const QModelIndex \&destinationParent, int destinationColumn)
This signal is emitted just before columns are moved within the model. The items that will be moved are those between sourceStart and sourceEnd inclusive, under the given sourceParent item. They will be moved to destinationParent starting at the column destinationColumn.
Note: Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code.
Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.
This function was introduced in Qt 4.6.
See also beginMoveRows().
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#columnsAboutToBeMoved
columnsAboutToBeRemoved
columnsAboutToBeRemoved(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtCore.QAbstractItemModel.columnsAboutToBeRemoved; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QAbstractItemModel::columnsAboutToBeRemoved(const QModelIndex \&parent, int first, int last)
This signal is emitted just before columns are removed from the model. The items to be removed are those between first and last inclusive, under the given parent item.
Note: Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code.
Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.
See also removeColumns() and beginRemoveColumns().
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#columnsAboutToBeRemoved
columnsInserted
columnsInserted(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtCore.QAbstractItemModel.columnsInserted; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QAbstractItemModel::columnsInserted(const QModelIndex \&parent, int first, int last)
This signal is emitted after columns have been inserted into the model. The new items are those between first and last inclusive, under the given parent item.
Note: Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code.
Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.
See also insertColumns() and beginInsertColumns().
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#columnsInserted
columnsMoved
columnsMoved(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtCore.QAbstractItemModel.columnsMoved; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QAbstractItemModel::columnsMoved(const QModelIndex \&parent, int start, int end, const QModelIndex \&destination, int column)
This signal is emitted after columns have been moved within the model. The items between start and end inclusive, under the given parent item have been moved to destination starting at the column column.
Note: Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code.
Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.
This function was introduced in Qt 4.6.
See also beginMoveRows().
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#columnsMoved
columnsRemoved
columnsRemoved(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtCore.QAbstractItemModel.columnsRemoved; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QAbstractItemModel::columnsRemoved(const QModelIndex \&parent, int first, int last)
This signal is emitted after columns have been removed from the model. The removed items are those between first and last inclusive, under the given parent item.
Note: Components connected to this signal use it to adapt to changes in the model's dimensions. It can only be emitted by the QAbstractItemModel implementation, and cannot be explicitly emitted in subclass code.
Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.
See also removeColumns() and beginRemoveColumns().
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#columnsRemoved
createIndex
createIndex(row: int, column: int, id: Any) -> Any
X.createIndex(row, column, id) -> PythonQt.QtCore.QModelIndex
Supplemental documentation: Qt 5 reference:
[protected] QModelIndex QAbstractItemModel::createIndex(int row, int column, void *ptr \= nullptr) const
Creates a model index for the given row and column with the internal pointer ptr.
When using a QSortFilterProxyModel, its indexes have their own internal pointer. It is not advisable to access this internal pointer outside of the model. Use the data() function instead.
This function provides a consistent interface that model subclasses must use to create model indexes.
[protected] QModelIndex QAbstractItemModel::createIndex(int row, int column, quintptr id) const
Creates a model index for the given row and column with the internal identifier, id.
This function provides a consistent interface that model subclasses must use to create model indexes.
See also QModelIndex::internalId().
Upstream PySide2 reference signatures (binding differences may apply):
createIndex(self, row: int, column: int, id: int=...) -> PySide2.QtCore.QModelIndex
createIndex(self, row: int, column: int, ptr: object) -> PySide2.QtCore.QModelIndex
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#createIndex
data
data(index: Any, role: int) -> Any
X.data(index, role) -> object
Supplemental documentation: Qt 5 reference:
[pure virtual] QVariant QAbstractItemModel::data(const QModelIndex \&index, int role \= Qt::DisplayRole) const
Returns the data stored under the given role for the item referred to by the index.
Note: If you do not have a value to return, return an invalid QVariant instead of returning 0.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also Qt::ItemDataRole, setData(), and headerData().
Upstream PySide2 reference signatures (binding differences may apply):
data(self, index: PySide2.QtCore.QModelIndex, role: int=...) -> typing.Any
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#data
dataChanged
dataChanged(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtCore.QAbstractItemModel.dataChanged; argument details are not documented.
Supplemental documentation: Qt 5 reference:
[signal] void QAbstractItemModel::dataChanged(const QModelIndex \&topLeft, const QModelIndex \&bottomRight, const QVector\<int> \&roles \= QVector\<int>())
This signal is emitted whenever the data in an existing item changes.
If the items are of the same parent, the affected ones are those between topLeft and bottomRight inclusive. If the items do not have the same parent, the behavior is undefined.
When reimplementing the setData() function, this signal must be emitted explicitly.
The optional roles argument can be used to specify which data roles have actually been modified. An empty vector in the roles argument means that all roles should be considered modified. The order of elements in the roles argument does not have any relevance.
See also headerDataChanged(), setData(), and layoutChanged().
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#dataChanged
decodeData
decodeData(row: int, column: int, parent: Any, stream: Any) -> bool
X.decodeData(row, column, parent, stream) -> bool
Upstream PySide2 reference signatures (binding differences may apply):
decodeData(self, row: int, column: int, parent: PySide2.QtCore.QModelIndex, stream: PySide2.QtCore.QDataStream) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#decodeData
destroyed
destroyed(*args: Any, **kwargs: Any) -> Any
Native PythonQt.QtCore.QAbstractItemModel.destroyed; argument details are not documented.
dropMimeData
dropMimeData(data: Any, action: Any, row: int, column: int, parent: Any) -> bool
X.dropMimeData(data, action, row, column, parent) -> bool
Supplemental documentation: Qt 5 reference:
[virtual] bool QAbstractItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex \&parent)
Handles the data supplied by a drag and drop operation that ended with the given action.
Returns true if the data and action were handled by the model; otherwise returns
false.
The specified row, column and parent indicate the location of an item in the model where the operation ended. It is the responsibility of the model to complete the action at the correct location.
For instance, a drop action on an item in a QTreeView can result in new items either being inserted as children of the item specified by row, column, and parent, or as siblings of the item.
When row and column are -1 it means that the dropped data should be considered as dropped directly on parent. Usually this will mean appending the data as child items of parent. If row and column are greater than or equal zero, it means that the drop occurred just before the specified row and column in the specified parent.
The mimeTypes() member is called to get the list of acceptable MIME types. This default implementation assumes the default implementation of mimeTypes(), which returns a single default MIME type. If you reimplement mimeTypes() in your custom model to return multiple MIME types, you must reimplement this function to make use of them.
See also supportedDropActions(), canDropMimeData(), and Using drag and drop with item views.
Upstream PySide2 reference signatures (binding differences may apply):
dropMimeData(self, data: PySide2.QtCore.QMimeData, action: PySide2.QtCore.Qt.DropAction, row: int, column: int, parent: PySide2.QtCore.QModelIndex) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#dropMimeData
encodeData
encodeData(indexes: Any, stream: Any) -> None
X.encodeData(indexes, stream)
Upstream PySide2 reference signatures (binding differences may apply):
encodeData(self, indexes: typing.List[int], stream: PySide2.QtCore.QDataStream) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#encodeData
endInsertColumns
endInsertColumns() -> None
X.endInsertColumns()
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::endInsertColumns()
Ends a column insertion operation.
When reimplementing insertColumns() in a subclass, you must call this function after inserting data into the model's underlying data store.
See also beginInsertColumns().
Upstream PySide2 reference signatures (binding differences may apply):
endInsertColumns(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#endInsertColumns
endInsertRows
endInsertRows() -> None
X.endInsertRows()
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::endInsertRows()
Ends a row insertion operation.
When reimplementing insertRows() in a subclass, you must call this function after inserting data into the model's underlying data store.
See also beginInsertRows().
Upstream PySide2 reference signatures (binding differences may apply):
endInsertRows(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#endInsertRows
endMoveColumns
endMoveColumns() -> None
X.endMoveColumns()
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::endMoveColumns()
Ends a column move operation.
When implementing a subclass, you must call this function after moving data within the model's underlying data store.
This function was introduced in Qt 4.6.
See also beginMoveColumns().
Upstream PySide2 reference signatures (binding differences may apply):
endMoveColumns(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#endMoveColumns
endMoveRows
endMoveRows() -> None
X.endMoveRows()
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::endMoveRows()
Ends a row move operation.
When implementing a subclass, you must call this function after moving data within the model's underlying data store.
This function was introduced in Qt 4.6.
See also beginMoveRows().
Upstream PySide2 reference signatures (binding differences may apply):
endMoveRows(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#endMoveRows
endRemoveColumns
endRemoveColumns() -> None
X.endRemoveColumns()
Supplemental documentation: Qt 5 reference:
[protected] void QAbstractItemModel::endRemoveColumns()
Ends a column removal operation.
When reimplementing removeColumns() in a subclass, you must call this function after removing data from the model's underlying data store.
See also beginRemoveColumns().
Upstream PySide2 reference signatures (binding differences may apply):
endRemoveColumns(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qabstractitemmodel.html#endRemoveColumns