QConcatenateTablesProxyModel¶
The
QConcatenateTablesProxyModel
class proxies multiple source models, concatenating their rows. More…
New in version 5.13.
Synopsis¶
Functions¶
def
addSourceModel
(sourceModel)def
mapFromSource
(sourceIndex)def
mapToSource
(proxyIndex)def
removeSourceModel
(sourceModel)def
sourceModels
()
Detailed Description¶
QConcatenateTablesProxyModel
takes multiple source models and concatenates their rows.In other words, the proxy will have all rows of the first source model, followed by all rows of the second source model, and so on.
If the source models don’t have the same number of columns, the proxy will only have as many columns as the source model with the smallest number of columns. Additional columns in other source models will simply be ignored.
Source models can be added and removed at runtime, and the column count is adjusted accordingly.
This proxy does not inherit from
QAbstractProxyModel
because it uses multiple source models, rather than a single one.Only flat models (lists and tables) are supported, tree models are not.
- class PySide2.QtCore.QConcatenateTablesProxyModel([parent=None])¶
- param parent:
Constructs a concatenate-rows proxy model with the given
parent
.
- PySide2.QtCore.QConcatenateTablesProxyModel.addSourceModel(sourceModel)¶
- Parameters:
sourceModel –
PySide2.QtCore.QAbstractItemModel
Adds a source model
sourceModel
, below all previously added source models.The ownership of
sourceModel
is not affected by this.The same source model cannot be added more than once.
- PySide2.QtCore.QConcatenateTablesProxyModel.mapFromSource(sourceIndex)¶
- Parameters:
sourceIndex –
PySide2.QtCore.QModelIndex
- Return type:
Returns the proxy index for a given
sourceIndex
, which can be from any of the source models.
- PySide2.QtCore.QConcatenateTablesProxyModel.mapToSource(proxyIndex)¶
- Parameters:
proxyIndex –
PySide2.QtCore.QModelIndex
- Return type:
Returns the source index for a given
proxyIndex
.
- PySide2.QtCore.QConcatenateTablesProxyModel.removeSourceModel(sourceModel)¶
- Parameters:
sourceModel –
PySide2.QtCore.QAbstractItemModel
Removes the source model
sourceModel
, which was previously added to this proxy.The ownership of
sourceModel
is not affected by this.
- PySide2.QtCore.QConcatenateTablesProxyModel.sourceModels()¶
- Return type:
Returns a list of models that were added as source models for this proxy model.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.