class QTableView2(QTableView):
Method | __init__ |
Initializes a table. |
Method | focusInEvent |
Gets called when the table gained focus. This highlights the border and selects the last-selected cell (if any). |
Method | focusOutEvent |
Gets called when the table lost focus, or when a cell is being edited. When not editing, this clears the selection, triggering on_selection_changed() . |
Method | get_selected_row |
Returns the currently selected row index. |
Method | on_combobox_cell_edited |
Gets called when a combobox cell has been edited. |
Method | on_data_changed |
Gets called when the data in a selection changed. Note: Always assuming only a single cell is selected. |
Method | on_row_deleted |
Gets called when a row was deleted. |
Method | on_selection_changed |
Gets called when the selection changed. |
Method | select_cell |
Selects a cell. Any parameter may be left set to None in order to load its value from the selection model. |
Method | select_last_row |
Selects the last row. |
Method | set_data |
Sets the table contents. |
Method | set_style |
Sets this widget's style. |
Instance Variable | gui |
Undocumented |
Instance Variable | _allow_delete |
Undocumented |
Instance Variable | _col_keys |
Undocumented |
Instance Variable | _col_options |
Undocumented |
Instance Variable | _col_types |
Undocumented |
Instance Variable | _on_cell_edited |
Undocumented |
Instance Variable | _on_row_deleted |
Undocumented |
Instance Variable | _on_selection_changed |
Undocumented |
Instance Variable | _row_count_minimum |
Undocumented |
Instance Variable | _row_prefix |
Undocumented |
Parameters | |
gui:GUI | GUI |
col_keys:List[ | List of horizontal header strings |
col_types:Optional[ | Per-column cell types used for binding cells to configuration. Ordered dictionary of key-value pairs (column key : column type) or None to disable binding. Note: Currently, *only the keys* are used for binding cells to project configuration; the cell options actually determine the cell type, i.e. numerical or combobox. |
col_options:Optional[ | Per-column cell options. This determines the cell type, i.e. numerical or combobox. List of options for every column; items may be set to None to use numerical cells. |
row_allow_delete:bool | Enable to add an extra column for row delete buttons |
row_count_minimum:int | Minimum number of rows (no further rows can be deleted) |
row_prefix:str | Per-row prefix used for binding cells to configuration (key = prefix + column key + "_" + row index) |
on_cell_edited:Optional[ | Set this to make cells editable |
on_selection_changed:Optional[ | Used to inform the GUI that another row was selected |
on_row_deleted:Optional[ | Set this to make rows deletable |
Parameters | |
_event:QFocusEvent | QFocusEvent |
on_selection_changed()
.Parameters | |
_event:QFocusEvent | QFocusEvent |
Returns | |
Optional[ | Index of currently selected row (None if none selected) |
Parameters | |
combobox:QComboBox | QCombobox |
row:int | Row index |
column:int | Column index |
Parameters | |
top_left_index:QtCore.QModelIndex | Model index of the top left selection bounds |
_bottom_right_index:QtCore.QModelIndex | Model index of the bottom right selection bounds |
Parameters | |
_selected:QItemSelection | Currently selected QItemSelection |
_deselected:QItemSelection | Currently deselected QItemSelection |
Parameters | |
row:Optional[ | Row |
col:Optional[ | Column |
Parameters | |
focus:bool | Enable to focus the table, disable to explicitly clear the visual selection |
Parameters | |
data:List[ | Data (2D) |
row_keys:List[ | List of vertical header strings |