Class: QgsTableWidgetItem

This can be used like a regular QTableWidgetItem with the difference that a specific role can be set to sort.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsTableWidgetItem

Base classes

QTableWidgetItem

Methods

setSortRole

Set the role by which the items should be sorted.

sortRole

Gets the role by which the items should be sorted.

class qgis.gui.QgsTableWidgetItem[source]

Bases: QTableWidgetItem

__init__()
__init__(text: str | None)

Creates a new table widget item with the specified text.

Parameters:

text (Optional[str])

__init__(a0: QgsTableWidgetItem)
Parameters:

a0 (QgsTableWidgetItem)

setSortRole(self, role: int)[source]

Set the role by which the items should be sorted. By default this will be set to Qt.DisplayRole

Parameters:

role (int)

sortRole(self) int[source]

Gets the role by which the items should be sorted. By default this will be Qt.DisplayRole

Return type:

int