Class: QgsTableWidgetItem¶
- class qgis.gui.QgsTableWidgetItem¶
Bases:
PyQt5.QtWidgets.QTableWidgetItem
This can be used like a regular QTableWidgetItem with the difference that a specific role can be set to sort.
QgsTableWidgetItem() Constructor for QgsTableWidgetItem.
QgsTableWidgetItem(text: Optional[str]) Creates a new table widget item with the specified text.
QgsTableWidgetItem(a0:
QgsTableWidgetItem
)Methods
Set the role by which the items should be sorted.
Gets the role by which the items should be sorted.
- setSortRole(self, role: int)¶
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 ¶
Gets the role by which the items should be sorted. By default this will be Qt.DisplayRole
- Return type:
int