table_view

Module Contents

TableItemDelegate

TableBase

Table base class

TableWidget

Table widget

TableView

Table view

class TableItemDelegate(parent: PyQt5.QtWidgets.QTableView)

Bases: PyQt5.QtWidgets.QStyledItemDelegate

margin = 2
hoverRow = -1
pressedRow = -1
selectedRows
lightCheckedColor
darkCheckedColor
setHoverRow(row: int)
setPressedRow(row: int)
setSelectedRows(indexes: List[PyQt5.QtCore.QModelIndex])
sizeHint(option, index)
createEditor(parent: PyQt5.QtWidgets.QWidget, option: PyQt5.QtWidgets.QStyleOptionViewItem, index: PyQt5.QtCore.QModelIndex) PyQt5.QtWidgets.QWidget
updateEditorGeometry(editor: PyQt5.QtWidgets.QWidget, option: PyQt5.QtWidgets.QStyleOptionViewItem, index: PyQt5.QtCore.QModelIndex)
setCheckedColor(light, dark)

set the color of indicator in checked status

Parameters

light, dark: str | QColor | Qt.GlobalColor

color in light/dark theme mode

initStyleOption(option: PyQt5.QtWidgets.QStyleOptionViewItem, index: PyQt5.QtCore.QModelIndex)
paint(painter, option, index)
helpEvent(event: PyQt5.QtGui.QHelpEvent, view: PyQt5.QtWidgets.QAbstractItemView, option: PyQt5.QtWidgets.QStyleOptionViewItem, index: PyQt5.QtCore.QModelIndex) bool
class TableBase(*args, **kwargs)

Table base class

delegate
scrollDelagate
setBorderVisible(isVisible: bool)

set the visibility of border

setBorderRadius(radius: int)

set the radius of border

setCheckedColor(light, dark)

set the color in checked status

Parameters

light, dark: str | QColor | Qt.GlobalColor

color in light/dark theme mode

leaveEvent(e)
resizeEvent(e)
keyPressEvent(e: PyQt5.QtGui.QKeyEvent)
mousePressEvent(e)
mouseReleaseEvent(e)
setItemDelegate(delegate: TableItemDelegate)
selectAll()
selectRow(row: int)
clearSelection()
setCurrentIndex(index: PyQt5.QtCore.QModelIndex)
updateSelectedRows()
class TableWidget(parent=None)

Bases: TableBase, PyQt5.QtWidgets.QTableWidget

Table widget

setCurrentCell(row: int, column: int, command: PyQt5.QtCore.QItemSelectionModel.SelectionFlag | PyQt5.QtCore.QItemSelectionModel.SelectionFlags = None)
setCurrentItem(item: PyQt5.QtWidgets.QTableWidgetItem, command: PyQt5.QtCore.QItemSelectionModel.SelectionFlag | PyQt5.QtCore.QItemSelectionModel.SelectionFlags = None)
isSelectRightClickedRow()
setSelectRightClickedRow(isSelect: bool)
selectRightClickedRow
class TableView(parent=None)

Bases: TableBase, PyQt5.QtWidgets.QTableView

Table view

isSelectRightClickedRow()
setSelectRightClickedRow(isSelect: bool)
selectRightClickedRow