7.5.6.1.6. pymodaq_gui.utils.widgets.table module

class pymodaq_gui.utils.widgets.table.BooleanDelegate[source]

Bases: QItemEditorFactory

TO implement custom widget editor for cells in a tableview

Methods

createEditor(self, userType, parent)

createEditor(self, userType: int, parent: QWidget | None) QWidget | None[source]
class pymodaq_gui.utils.widgets.table.MyStyle[source]

Bases: QProxyStyle

Methods

drawPrimitive(element, option, painter[, widget])

Draw a line across the entire row rather than just the column we're hovering over.

drawPrimitive(element, option, painter, widget=None)[source]

Draw a line across the entire row rather than just the column we’re hovering over. This may not always work depending on global style - for instance I think it won’t work on OSX.

class pymodaq_gui.utils.widgets.table.SpinBoxDelegate(decimals=4, min=-1000000.0, max=1000000.0)[source]

Bases: QItemEditorFactory

Methods

createEditor(self, userType, parent)

createEditor(self, userType: int, parent: QWidget | None) QWidget | None[source]
class pymodaq_gui.utils.widgets.table.TableModel(data, header, editable=True, parent=None, show_checkbox=False)[source]

Bases: QAbstractTableModel

Attributes:
raw_data

Methods

columnCount(self[, parent])

data(self, index[, role])

dropMimeData(self, data, action, row, ...)

flags(self, index)

headerData(self, section, orientation[, role])

insertRows(self, row, count[, parent])

removeRows(self, row, count[, parent])

rowCount(self[, parent])

setData(self, index, value[, role])

supportedDropActions(self)

validate_data(row, col, value)

to be subclassed in order to validate ranges of values for the cell defined by index :param index: :type index: (QModelIndex) :param value: :type value: (str or float or int or ...)

clear

get_data

get_data_all

insert_data

is_checked

remove_row

set_data_all

clear()[source]
columnCount(self, parent: QModelIndex = QModelIndex()) int[source]
data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) Any[source]
dropMimeData(self, data: QMimeData | None, action: Qt.DropAction, row: int, column: int, parent: QModelIndex) bool[source]
flags(self, index: QModelIndex) Qt.ItemFlags[source]
get_data(row, col)[source]
get_data_all()[source]
headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.ItemDataRole.DisplayRole) Any[source]
insertRows(self, row: int, count: int, parent: QModelIndex = QModelIndex()) bool[source]
insert_data(row, data)[source]
is_checked(row: int)[source]
removeRows(self, row: int, count: int, parent: QModelIndex = QModelIndex()) bool[source]
remove_row(row)[source]
rowCount(self, parent: QModelIndex = QModelIndex()) int[source]
setData(self, index: QModelIndex, value: Any, role: int = Qt.ItemDataRole.EditRole) bool[source]
set_data_all(data)[source]
supportedDropActions(self) Qt.DropActions[source]
validate_data(row, col, value)[source]

to be subclassed in order to validate ranges of values for the cell defined by index :param index: :type index: (QModelIndex) :param value: :type value: (str or float or int or …)

Returns:

bool

Return type:

True if value is valid for the given row and col

property raw_data
class pymodaq_gui.utils.widgets.table.TableView(*args, **kwargs)[source]

Bases: QTableView

Methods

setupview

setupview()[source]