PythonQt.Qt.QSortFilterProxyModel
QSortFilterProxyModel
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
QSortFilterProxyModel can be used for sorting items, filtering out items, or both. The model transforms the structure of a source model by mapping the model indexes it supplies to new indexes, corresponding to different locations, for views to use. This approach allows a given source model to be restructured as far as views are concerned without requiring any transformations on the underlying data, and without duplicating the data in memory.
Let's assume that we want to sort and filter the items provided by a custom model. The code to set up the model and the view, without sorting and filtering, would look like this:
QTreeView *treeView = new QTreeView;
MyItemModel *model = new MyItemModel(this);
treeView->setModel(model);
To add sorting and filtering support to MyItemModel, we need to create a
QSortFilterProxyModel, call
setSourceModel()
with the MyItemModel as argument, and install the QSortFilterProxyModel on the view:
QTreeView *treeView = new QTreeView;
MyItemModel *sourceModel = new MyItemModel(this);
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(sourceModel);
treeView->setModel(proxyModel);
At this point, neither sorting nor filtering is enabled; the original data is displayed in the view. Any changes made through the QSortFilterProxyModel are applied to the original model.
The QSortFilterProxyModel acts as a wrapper for the original model. If you need to convert source QModelIndexes to sorted/filtered model indexes or vice versa, use mapToSource(), mapFromSource(), mapSelectionToSource(), and mapSelectionFromSource().
Note: By default, the model dynamically re-sorts and re-filters data whenever the original model changes. This behavior can be changed by setting the dynamicSortFilter property.
The Basic Sort/Filter Model and Custom Sort/Filter Model examples illustrate how to use QSortFilterProxyModel to perform basic sorting and filtering and how to subclass it to implement custom behavior.
Sorting
QTableView and QTreeView have a sortingEnabled property that controls whether the user can sort the view by clicking the view's horizontal header. For example:
treeView->setSortingEnabled(true);
When this feature is on (the default is off), clicking on a header section sorts the items according to that column. By clicking repeatedly, the user can alternate between ascending and descending order.

Behind the scene, the view calls the
sort() virtual
function on the model to reorder the data in the model. To make your data sortable, you
can either implement
sort() in your
model, or use a QSortFilterProxyModel to wrap your model -- QSortFilterProxyModel
provides a generic
sort()
reimplementation that operates on the
sortRole()
(Qt::DisplayRole by
default) of the items and that understands several data types, including int,
QString, and
QDateTime. For hierarchical models,
sorting is applied recursively to all child items. String comparisons are case sensitive
by default; this can be changed by setting the
sortCaseSensitivity
property.
Custom sorting behavior is achieved by subclassing QSortFilterProxyModel and reimplementing lessThan(), which is used to compare items. For example:
bool MySortFilterProxyModel::lessThan(const QModelIndex &left,
const QModelIndex &right) const
{
QVariant leftData = sourceModel()->data(left);
QVariant rightData = sourceModel()->data(right);
if (leftData.userType() == QMetaType::QDateTime) {
return leftData.toDateTime() < rightData.toDateTime();
} else {
static const QRegularExpression emailPattern("[\\w\\.]*@[\\w\\.]*");
QString leftString = leftData.toString();
if (left.column() == 1) {
const QRegularExpressionMatch match = emailPattern.match(leftString);
if (match.hasMatch())
leftString = match.captured(0);
}
QString rightString = rightData.toString();
if (right.column() == 1) {
const QRegularExpressionMatch match = emailPattern.match(rightString);
if (match.hasMatch())
rightString = match.captured(0);
}
return QString::localeAwareCompare(leftString, rightString) < 0;
}
}
(This code snippet comes from the Custom Sort/Filter Model example.)
An alternative approach to sorting is to disable sorting on the view and to impose a certain order to the user. This is done by explicitly calling sort() with the desired column and order as arguments on the QSortFilterProxyModel (or on the original model if it implements sort()). For example:
proxyModel->sort(2, Qt::AscendingOrder);
QSortFilterProxyModel can be sorted by column -1, in which case it returns to the sort order of the underlying source model.
Filtering
In addition to sorting, QSortFilterProxyModel can be used to hide items that do not match a certain filter. The filter is specified using a QRegExp object and is applied to the filterRole() (Qt::DisplayRole by default) of each item, for a given column. The QRegExp object can be used to match a regular expression, a wildcard pattern, or a fixed string. For example:
proxyModel->setFilterRegExp(QRegExp(".png", Qt::CaseInsensitive,
QRegExp::FixedString));
proxyModel->setFilterKeyColumn(1);
For hierarchical models, the filter is applied recursively to all children. If a parent item doesn't match the filter, none of its children will be shown.
A common use case is to let the user specify the filter regular expression, wildcard pattern, or fixed string in a QLineEdit and to connect the textChanged() signal to setFilterRegularExpression(), setFilterWildcard(), or setFilterFixedString() to reapply the filter.
Custom filtering behavior can be achieved by reimplementing the filterAcceptsRow() and filterAcceptsColumn() functions. For example (from the Custom Sort/Filter Model example), the following implementation ignores the filterKeyColumn property and performs filtering on columns 0, 1, and 2:
bool MySortFilterProxyModel::filterAcceptsRow(int sourceRow,
const QModelIndex &sourceParent) const
{
QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
QModelIndex index1 = sourceModel()->index(sourceRow, 1, sourceParent);
QModelIndex index2 = sourceModel()->index(sourceRow, 2, sourceParent);
return (sourceModel()->data(index0).toString().contains(filterRegExp())
|| sourceModel()->data(index1).toString().contains(filterRegExp()))
&& dateInRange(sourceModel()->data(index2).toDate());
}
(This code snippet comes from the Custom Sort/Filter Model example.)
If you are working with large amounts of filtering and have to invoke invalidateFilter() repeatedly, using beginResetModel() / endResetModel() may be more efficient, depending on the implementation of your model. However, beginResetModel() / endResetModel() returns the proxy model to its original state, losing selection information, and will cause the proxy model to be repopulated.
Subclassing
Since QAbstractProxyModel and its subclasses are derived from QAbstractItemModel, much of the same advice about subclassing normal models also applies to proxy models. In addition, it is worth noting that many of the default implementations of functions in this class are written so that they call the equivalent functions in the relevant source model. This simple proxying mechanism may need to be overridden for source models with more complex behavior; for example, if the source model provides a custom hasChildren() implementation, you should also provide one in the proxy model.
Note: Some general guidelines for subclassing models are available in the Model Subclassing Reference.
Note: With Qt 5, regular expression support has been improved through the QRegularExpression class. QSortFilterProxyModel dating back prior to that class creation, it originally supported only QRegExp. Since Qt 5.12, QRegularExpression APIs have been added. Therefore, QRegExp APIs should be considered deprecated and the QRegularExpression version should be used in place.
Warning: Don't mix calls to the getters and setters of different regexp types as this will lead to unexpected results. For maximum compatibility, the original implementation has been kept. Therefore, if, for example, a call to setFilterRegularExpression is made followed by another one to setFilterFixedString, the first call will setup a QRegularExpression object to use as filter while the second will setup a QRegExp in FixedString mode. However, this is an implementation detail that might change in the future.
Source: https://doc.qt.io/archives/qt-5.15/qsortfilterproxymodel.html
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
CheckIndexOption |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
DoNotUseParent |
attribute | Any |
(shared captured text) |
HorizontalSortHint |
attribute | Any |
(shared captured text) |
IndexIsValid |
attribute | Any |
(shared captured text) |
LayoutChangeHint |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
NoLayoutChangeHint |
attribute | Any |
(shared captured text) |
NoOption |
attribute | Any |
(shared captured text) |
ParentIsInvalid |
attribute | Any |
(shared captured text) |
VerticalSortHint |
attribute | Any |
(shared captured text) |
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
beginInsertColumns |
function | (self, parent: Any, first: Any, last: Any) -> Any |
X.beginInsertColumns(parent, first, last) (shared captured text) |
beginInsertRows |
function | (self, parent: Any, first: Any, last: Any) -> Any |
X.beginInsertRows(parent, first, last) (shared captured text) |
beginMoveColumns |
function | (self, sourceParent: Any, sourceFirst: Any, sourceLast: Any, destinationParent: Any, destinationColumn: Any) … |
X.beginMoveColumns(sourceParent, sourceFirst, sourceLast, destinationParent, destinationColumn) -> bool (shared captured text) |
beginMoveRows |
function | (self, sourceParent: Any, sourceFirst: Any, sourceLast: Any, destinationParent: Any, destinationRow: Any) -> … |
X.beginMoveRows(sourceParent, sourceFirst, sourceLast, destinationParent, destinationRow) -> bool (shared captured text) |
beginRemoveColumns |
function | (self, parent: Any, first: Any, last: Any) -> Any |
X.beginRemoveColumns(parent, first, last) (shared captured text) |
beginRemoveRows |
function | (self, parent: Any, first: Any, last: Any) -> Any |
X.beginRemoveRows(parent, first, last) (shared captured text) |
beginResetModel |
function | (self) -> Any |
(shared captured text) |
blockSignals |
function | (self, b: Any) -> bool |
X.blockSignals(b) -> bool (shared captured text) |
buddy |
function | (self, index: Any) -> Any |
X.buddy(index) -> PythonQt.QtCore.QModelIndex (shared captured text) |
canDropMimeData |
function | (self, data: Any, action: Any, row: Any, column: Any, parent: Any) -> bool |
X.canDropMimeData(data, action, row, column, parent) -> bool (shared captured text) |
canFetchMore |
function | (self, parent: Any) -> bool |
X.canFetchMore(parent) -> bool (shared captured text) |
changePersistentIndex |
function | (self, *args: Any, **kwargs: Any) -> Any |
X.changePersistentIndex(from, to) (shared captured text) |
changePersistentIndexList |
function | (self, *args: Any, **kwargs: Any) -> Any |
X.changePersistentIndexList(from, to) (shared captured text) |
childEvent |
function | (self, event: Any) -> Any |
(shared captured text) |
children |
function | (self) -> tuple |
X.children() -> tuple (shared captured text) |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
clear |
function | (self) -> Any |
(shared captured text) |
columnCount |
function | (self, parent: Any) -> int |
X.columnCount(parent) -> int (shared captured text) |
columnsAboutToBeInserted |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.columnsAboutToBeInserted; argument details are not documented. |
columnsAboutToBeMoved |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.columnsAboutToBeMoved; argument details are not documented. |
columnsAboutToBeRemoved |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.columnsAboutToBeRemoved; argument details are not documented. |
columnsInserted |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.columnsInserted; argument details are not documented. |
columnsMoved |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.columnsMoved; argument details are not documented. |
columnsRemoved |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.columnsRemoved; argument details are not documented. |
connect |
function | (self, signal: Any, receiver: Any, slot: Any, type: Any) -> bool |
X.connect(signal, receiver, slot, type) -> bool (shared captured text) |
createIndex |
function | (self, row: Any, column: Any, id: Any) -> Any |
X.createIndex(row, column, id) -> PythonQt.QtCore.QModelIndex (shared captured text) |
customEvent |
function | (self, event: Any) -> Any |
(shared captured text) |
data |
function | (self, index: Any, role: int) -> Any |
X.data(index, role) -> object (shared captured text) |
dataChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.dataChanged; argument details are not documented. |
decodeData |
function | (self, row: Any, column: Any, parent: Any, stream: Any) -> bool |
X.decodeData(row, column, parent, stream) -> bool (shared captured text) |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
deleteLater |
function | (self) -> Any |
(shared captured text) |
destroyed |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.destroyed; argument details are not documented. |
disconnect |
function | (self, signal: Any, receiver: Any, slot: Any) -> bool |
X.disconnect(signal, receiver, slot) -> bool (shared captured text) |
dropMimeData |
function | (self, data: Any, action: Any, row: int, column: int, parent: Any) -> bool |
X.dropMimeData(data, action, row, column, parent) -> bool (shared captured text) |
dumpObjectInfo |
function | (self) -> Any |
(shared captured text) |
dumpObjectTree |
function | (self) -> Any |
(shared captured text) |
dynamicPropertyNames |
function | (self) -> Any |
(shared captured text) |
dynamicSortFilter |
attribute | bool |
This property holds whether the proxy model is dynamically sorted and filtered whenever the contents of the source model change (shared captured text) |
dynamicSortFilterChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.dynamicSortFilterChanged; argument details are not documented. |
encodeData |
function | (self, indexes: Any, stream: Any) -> Any |
X.encodeData(indexes, stream) (shared captured text) |
endInsertColumns |
function | (self) -> Any |
(shared captured text) |
endInsertRows |
function | (self) -> Any |
(shared captured text) |
endMoveColumns |
function | (self) -> Any |
(shared captured text) |
endMoveRows |
function | (self) -> Any |
(shared captured text) |
endRemoveColumns |
function | (self) -> Any |
(shared captured text) |
endRemoveRows |
function | (self) -> Any |
(shared captured text) |
endResetModel |
function | (self) -> Any |
(shared captured text) |
event |
function | (self, event: Any) -> bool |
X.event(event) -> bool (shared captured text) |
eventFilter |
function | (self, watched: Any, event: Any) -> bool |
X.eventFilter(watched, event) -> bool (shared captured text) |
fetchMore |
function | (self, parent: Any) -> None |
Reimplements: [QAbstractProxyModel::fetchMore](https://doc.qt.io/archives/qt-5.15/qabstractproxymodel.html#fetchMore)(const QModelIndex \&parent). (shared captured text) |
filterAcceptsColumn |
function | (self, source_column: int, source_parent: Any) -> bool |
X.filterAcceptsColumn(source_column, source_parent) -> bool (shared captured text) |
filterAcceptsRow |
function | (self, source_row: int, source_parent: Any) -> bool |
X.filterAcceptsRow(source_row, source_parent) -> bool (shared captured text) |
filterCaseSensitivity |
attribute | Any |
This property holds the case sensitivity of the [QRegExp](https://doc.qt.io/archives/qt-5.15/qregexp.html) pattern used to filter the contents of the source model. (shared captured text) |
filterCaseSensitivityChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.filterCaseSensitivityChanged; argument details are not documented. |
filterKeyColumn |
attribute | int |
This property holds the column where the key used to filter the contents of the source model is read from. (shared captured text) |
filterRegExp |
attribute | QRegExp |
This property holds the [QRegExp](https://doc.qt.io/archives/qt-5.15/qregexp.html) used to filter the contents of the source model (shared captured text) |
filterRegularExpression |
attribute | QRegularExpression |
This property holds the [QRegularExpression](https://doc.qt.io/archives/qt-5.15/qregularexpression.html) used to filter the contents of the source model (shared captured text) |
filterRole |
attribute | int |
This property holds the item role that is used to query the source model's data when filtering items. (shared captured text) |
filterRoleChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.filterRoleChanged; argument details are not documented. |
findChild |
function | (self, type: Any, name: Any) -> Any |
X.findChild(type, name) -> PythonQt.private.QObject (shared captured text) |
findChildren |
function | (self, type: Any, name: Any) -> tuple |
X.findChildren(type, name) -> tuple (shared captured text) |
flags |
function | (self, index: Any) -> Any |
Reimplements: [QAbstractProxyModel::flags](https://doc.qt.io/archives/qt-5.15/qabstractproxymodel.html#flags)(const QModelIndex \&index) const. (shared captured text) |
hasChildren |
function | (self, parent: Any) -> bool |
X.hasChildren(parent) -> bool (shared captured text) |
hasIndex |
function | (self, row: Any, column: Any, parent: Any) -> bool |
X.hasIndex(row, column, parent) -> bool (shared captured text) |
headerData |
function | (self, section: int, orientation: Any, role: int) -> Any |
X.headerData(section, orientation, role) -> object (shared captured text) |
headerDataChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.headerDataChanged; argument details are not documented. |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
index |
function | (self, row: int, column: int, parent: Any) -> Any |
X.index(row, column, parent) -> PythonQt.QtCore.QModelIndex (shared captured text) |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
insertColumn |
function | (self, column: Any, parent: Any) -> bool |
X.insertColumn(column, parent) -> bool (shared captured text) |
insertColumns |
function | (self, column: int, count: int, parent: Any) -> bool |
X.insertColumns(column, count, parent) -> bool (shared captured text) |
insertRow |
function | (self, row: Any, parent: Any) -> bool |
X.insertRow(row, parent) -> bool (shared captured text) |
insertRows |
function | (self, row: int, count: int, parent: Any) -> bool |
X.insertRows(row, count, parent) -> bool (shared captured text) |
installEventFilter |
function | (self, filterObj: Any) -> Any |
(shared captured text) |
invalidate |
function | (self) -> None |
Invalidates the current sorting and filtering. (shared captured text) |
invalidateFilter |
function | (self) -> None |
Invalidates the current filtering. (shared captured text) |
isSignalConnected |
function | (self, signal: Any) -> bool |
X.isSignalConnected(signal) -> bool (shared captured text) |
isSortLocaleAware |
attribute | bool |
This property holds the local aware setting used for comparing strings when sorting (shared captured text) |
isWidgetType |
function | (self) -> bool |
X.isWidgetType() -> bool (shared captured text) |
isWindowType |
function | (self) -> bool |
X.isWindowType() -> bool (shared captured text) |
itemData |
function | (self, index: Any) -> dict |
X.itemData(index) -> dict (shared captured text) |
killTimer |
function | (self, id: Any) -> Any |
(shared captured text) |
layoutAboutToBeChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.layoutAboutToBeChanged; argument details are not documented. |
layoutChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.layoutChanged; argument details are not documented. |
lessThan |
function | (self, source_left: Any, source_right: Any) -> bool |
X.lessThan(source_left, source_right) -> bool (shared captured text) |
mapFromSource |
function | (self, sourceIndex: Any) -> Any |
X.mapFromSource(sourceIndex) -> PythonQt.QtCore.QModelIndex (shared captured text) |
mapSelectionFromSource |
function | (self, sourceSelection: Any) -> Any |
X.mapSelectionFromSource(sourceSelection) -> PythonQt.QtGui.QItemSelection (shared captured text) |
mapSelectionToSource |
function | (self, proxySelection: Any) -> Any |
X.mapSelectionToSource(proxySelection) -> PythonQt.QtGui.QItemSelection (shared captured text) |
mapToSource |
function | (self, proxyIndex: Any) -> Any |
X.mapToSource(proxyIndex) -> PythonQt.QtCore.QModelIndex (shared captured text) |
match |
function | (self, start: Any, role: int, value: Any, hits: int, arg4: flags) -> tuple |
X.match(start, role, value, hits, flags) -> tuple (shared captured text) |
metaObject |
function | (self) -> Any |
X.metaObject() -> PythonQt.QtCore.QMetaObject (shared captured text) |
mimeData |
function | (self, indexes: Any) -> Any |
X.mimeData(indexes) -> PythonQt.QtCore.QMimeData (shared captured text) |
mimeTypes |
function | (self) -> tuple |
X.mimeTypes() -> tuple (shared captured text) |
modelAboutToBeReset |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.modelAboutToBeReset; argument details are not documented. |
modelReset |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.modelReset; argument details are not documented. |
moveColumn |
function | (self, sourceParent: Any, sourceColumn: Any, destinationParent: Any, destinationChild: Any) -> bool |
X.moveColumn(sourceParent, sourceColumn, destinationParent, destinationChild) -> bool (shared captured text) |
moveColumns |
function | (self, sourceParent: Any, sourceColumn: Any, count: Any, destinationParent: Any, destinationChild: Any) -> bo… |
X.moveColumns(sourceParent, sourceColumn, count, destinationParent, destinationChild) -> bool (shared captured text) |
moveRow |
function | (self, sourceParent: Any, sourceRow: Any, destinationParent: Any, destinationChild: Any) -> bool |
X.moveRow(sourceParent, sourceRow, destinationParent, destinationChild) -> bool (shared captured text) |
moveRows |
function | (self, sourceParent: Any, sourceRow: Any, count: Any, destinationParent: Any, destinationChild: Any) -> bool |
X.moveRows(sourceParent, sourceRow, count, destinationParent, destinationChild) -> bool (shared captured text) |
moveToThread |
function | (self, thread: Any) -> Any |
(shared captured text) |
objectName |
attribute | Any |
(shared captured text) |
objectNameChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.objectNameChanged; argument details are not documented. |
parent |
function | (self, child: Any) -> Any |
X.parent(child) -> PythonQt.QtCore.QModelIndex (shared captured text) |
persistentIndexList |
function | (self) -> tuple |
X.persistentIndexList() -> tuple (shared captured text) |
property |
function | (self, name: Any) -> Any |
X.property(name) -> object (shared captured text) |
recursiveFilteringEnabled |
attribute | Any |
This property holds whether the filter to be applied recursively on children, and for any matching child, its parents will be visible as well. (shared captured text) |
recursiveFilteringEnabledChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.recursiveFilteringEnabledChanged; argument details are not documented. |
removeColumn |
function | (self, column: Any, parent: Any) -> bool |
X.removeColumn(column, parent) -> bool (shared captured text) |
removeColumns |
function | (self, column: int, count: int, parent: Any) -> bool |
X.removeColumns(column, count, parent) -> bool (shared captured text) |
removeEventFilter |
function | (self, obj: Any) -> Any |
(shared captured text) |
removeRow |
function | (self, row: Any, parent: Any) -> bool |
X.removeRow(row, parent) -> bool (shared captured text) |
removeRows |
function | (self, row: int, count: int, parent: Any) -> bool |
X.removeRows(row, count, parent) -> bool (shared captured text) |
revert |
function | (self) -> Any |
(shared captured text) |
roleNames |
function | (self) -> dict |
X.roleNames() -> dict (shared captured text) |
rowCount |
function | (self, parent: Any) -> int |
X.rowCount(parent) -> int (shared captured text) |
rowsAboutToBeInserted |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.rowsAboutToBeInserted; argument details are not documented. |
rowsAboutToBeMoved |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.rowsAboutToBeMoved; argument details are not documented. |
rowsAboutToBeRemoved |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.rowsAboutToBeRemoved; argument details are not documented. |
rowsInserted |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.rowsInserted; argument details are not documented. |
rowsMoved |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.rowsMoved; argument details are not documented. |
rowsRemoved |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.rowsRemoved; argument details are not documented. |
sender |
function | (self) -> Any |
X.sender() -> PythonQt.private.QObject (shared captured text) |
senderSignalIndex |
function | (self) -> int |
X.senderSignalIndex() -> int (shared captured text) |
setData |
function | (self, index: Any, value: Any, role: int) -> bool |
X.setData(index, value, role) -> bool (shared captured text) |
setDynamicSortFilter |
function | (self, enable: bool) -> None |
(shared captured text) |
setFilterCaseSensitivity |
function | (self, cs: Any) -> None |
(shared captured text) |
setFilterFixedString |
function | (self, pattern: str) -> None |
Sets the fixed string used to filter the contents of the source model to the given pattern. (shared captured text) |
setFilterKeyColumn |
function | (self, column: int) -> None |
(shared captured text) |
setFilterRegExp |
function | (self, regExp: Any) -> None |
This is an overloaded function. (shared captured text) |
setFilterRegularExpression |
function | (self, pattern: Any) -> None |
Sets the regular expression used to filter the contents of the source model to pattern. (shared captured text) |
setFilterRole |
function | (self, role: int) -> None |
(shared captured text) |
setFilterWildcard |
function | (self, pattern: str) -> None |
Sets the wildcard expression used to filter the contents of the source model to the given pattern. (shared captured text) |
setHeaderData |
function | (self, section: int, orientation: Any, value: Any, role: int) -> bool |
X.setHeaderData(section, orientation, value, role) -> bool (shared captured text) |
setItemData |
function | (self, index: Any, roles: Any) -> bool |
X.setItemData(index, roles) -> bool (shared captured text) |
setObjectName |
function | (self, name: Any) -> Any |
(shared captured text) |
setParent |
function | (self, parent: Any) -> Any |
(shared captured text) |
setProperty |
function | (self, name: Any, value: Any) -> bool |
X.setProperty(name, value) -> bool (shared captured text) |
setSortCaseSensitivity |
function | (self, cs: Any) -> None |
(shared captured text) |
setSortLocaleAware |
function | (self, on: bool) -> None |
(shared captured text) |
setSortRole |
function | (self, role: int) -> None |
(shared captured text) |
setSourceModel |
function | (self, sourceModel: Any) -> None |
Reimplements: [QAbstractProxyModel::setSourceModel](https://doc.qt.io/archives/qt-5.15/qabstractproxymodel.html#setSourceModel)(QAbstractItemModel *sourceModel). (shared captured text) |
sibling |
function | (self, row: int, column: int, idx: Any) -> Any |
X.sibling(row, column, idx) -> PythonQt.QtCore.QModelIndex (shared captured text) |
signalsBlocked |
function | (self) -> bool |
X.signalsBlocked() -> bool (shared captured text) |
sort |
function | (self, column: int, order: Any) -> None |
X.sort(column, order) (shared captured text) |
sortCaseSensitivity |
attribute | Any |
This property holds the case sensitivity setting used for comparing strings when sorting (shared captured text) |
sortCaseSensitivityChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.sortCaseSensitivityChanged; argument details are not documented. |
sortColumn |
function | (self) -> int |
X.sortColumn() -> int (shared captured text) |
sortLocaleAwareChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.sortLocaleAwareChanged; argument details are not documented. |
sortOrder |
function | (self) -> Any |
Returns the order currently used for sorting (shared captured text) |
sortRole |
attribute | int |
This property holds the item role that is used to query the source model's data when sorting items. (shared captured text) |
sortRoleChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.sortRoleChanged; argument details are not documented. |
sourceModel |
attribute | QAbstractItemModel |
(shared captured text) |
sourceModelChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native PythonQt.Qt.QSortFilterProxyModel.sourceModelChanged; argument details are not documented. |
span |
function | (self, index: Any) -> Any |
X.span(index) -> PythonQt.QtCore.QSize (shared captured text) |
startTimer |
function | (self, interval: Any, timerType: Any) -> int |
X.startTimer(interval, timerType) -> int (shared captured text) |
submit |
function | (self) -> bool |
X.submit() -> bool (shared captured text) |
supportedDragActions |
function | (self) -> Any |
(shared captured text) |
supportedDropActions |
function | (self) -> Any |
Reimplements: [QAbstractProxyModel::supportedDropActions](https://doc.qt.io/archives/qt-5.15/qabstractproxymodel.html#supportedDropActions)() const. (shared captured text) |
thread |
function | (self) -> Any |
(shared captured text) |
timerEvent |
function | (self, event: Any) -> Any |
(shared captured text) |
tr |
function | (self, text: Any, ambig: Any, n: Any) -> str |
X.tr(text, ambig, n) -> str (shared captured text) |