8.5.6.1.8. pymodaq_gui.utils.widgets.table module

class pymodaq_gui.utils.widgets.table.BooleanDelegate(*args, **kwargs)[source]

Bases: QStyledItemDelegate

TO implement custom widget editor for cells in a tableview

Methods

createEditor

setEditorData

setModelData

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]
class pymodaq_gui.utils.widgets.table.MyStyle(*args, **kwargs)[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(*args: Any, **kwargs: Any)[source]

Bases: QStyledItemDelegate

Methods

createEditor

setEditorData

setModelData

createEditor(parent, option, index)[source]
setEditorData(editor, index)[source]
setModelData(editor, model, index)[source]
class pymodaq_gui.utils.widgets.table.TableModel(data, header, editable=True, parent=None, show_checkbox=False, cast=<class 'float'>)[source]

Bases: QAbstractTableModel

Attributes:
raw_data

Methods

columnCount(*args, **kwargs)

data(index, role)

dropMimeData(data, action, row, column, parent)

flags(index)

headerData(section, orientation, role)

insertRows(row, count, parent)

removeRows(row, count, parent)

rowCount(*args, **kwargs)

setData(index, value, role)

supportedDropActions()

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) :type value: (str or float or int or ) :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(*args, **kwargs)[source]
data(index, role)[source]
dropMimeData(data, action, row, column, parent)[source]
flags(index)[source]
get_data(row, col=None)[source]
get_data_all()[source]
headerData(section, orientation, role)[source]
insertRows(row, count, parent)[source]
insert_data(row, data)[source]
is_checked(row)[source]
removeRows(row, count, parent)[source]
remove_row(row)[source]
rowCount(*args, **kwargs)[source]
setData(index, value, role)[source]
set_data_all(data)[source]
supportedDropActions()[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) :type value: (str or float or int or ) :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: Any, **kwargs: Any)[source]

Bases: QTableView

Methods

setupview

setupview()[source]