Class: QgsTableWidgetItem¶
- class qgis.gui.QgsTableWidgetItem¶
Bases:
PyQt5.QtWidgets.QTableWidgetItem
Constructor for QgsTableWidgetItem.
QgsTableWidgetItem(text: str) Creates a new table widget item with the specified text.
QgsTableWidgetItem(
QgsTableWidgetItem
)This can be used like a regular QTableWidgetItem with the difference that a specific role can be set to sort.
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