ChangeHeadersProxyModel
Qt Base Class: QIdentityProxyModel
Signature: QIdentityProxyModel(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None
Base classes
Name | Children | Inherits |
---|---|---|
IdentityProxyModel prettyqt.core.identityproxymodel |
⋔ Inheritance diagram
graph TD
1473290754032["itemmodels.ChangeHeadersProxyModel"]
1473299892128["core.IdentityProxyModel"]
1473299903840["core.AbstractProxyModelMixin"]
1473299890176["core.AbstractItemModelMixin"]
1473299815024["core.ObjectMixin"]
140713234304496["builtins.object"]
1473289064768["QtCore.QIdentityProxyModel"]
1473289061840["QtCore.QAbstractProxyModel"]
1473289050128["QtCore.QAbstractItemModel"]
1473288842240["QtCore.QObject"]
1473291690208["Shiboken.Object"]
1473299892128 --> 1473290754032
1473299903840 --> 1473299892128
1473299890176 --> 1473299903840
1473299815024 --> 1473299890176
140713234304496 --> 1473299815024
1473289064768 --> 1473299892128
1473289061840 --> 1473289064768
1473289050128 --> 1473289061840
1473288842240 --> 1473289050128
1473291690208 --> 1473288842240
140713234304496 --> 1473291690208
🛈 DocStrings
Bases: IdentityProxyModel
Proxy model for changing the header data (either horizontal or vertical).
Header data can either be changed by passing a list with same length as source length or by passing a dictionary with index as key and new value as value (Example: {1: "abc", 3: "def"} changes section 1 to "abc" and section 3 to "def") Apart from the regular use case of changing the text, the other roles can be changed, too.
Example
table.proxifier.change_headers(header=["x", "y", "z"],
orientation=constants.HORIZONTAL,
role=constants.DISPLAY_ROLE
)
table.show()
# or
model = MyModel()
proxy = ChangeHeadersProxyModel(
header=["x", "y", "z"], orientation=constants.VERTICAL
)
proxy.set_source_model(model)
table.set_model(proxy)
table.show()
Source code in prettyqt\itemmodels\proxies\changeheadersproxymodel.py
⌗ Property table
Qt Property | Type | Doc |
---|---|---|
objectName |
QString | |
sourceModel |
QAbstractItemModel | |
header |
PySide::PyObjectWrapper | New headers (dict / list) |