commands.*¶
Pyspread undoable commands
Provides
SetColumnWidthSetRowHeight
-
class
commands.DeleteColumns(grid, model, index, column, count, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandDeletes grid columns
- Parameters
grid (
QTableView) – The main grid objectmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Parent from which the new columns are deletedcolumn (
int) – Column number of the first column to be deletedcount (
int) – Number of columns to be deleteddescription (
str) – Command description
-
class
commands.DeleteRows(grid, model, index, row, count, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandDeletes grid rows
- Parameters
-
class
commands.DeleteTable(grid, model, table, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandDeletes table
- Parameters
-
class
commands.FreezeCell(model, cells, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandFreezes cell in grid
- Parameters
-
class
commands.InsertColumns(grid, model, index, column, count, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandInserts grid columns
- Parameters
grid (
QTableView) – The main grid objectmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Parent into which the new columns are insertedcolumn (
int) – Column number of the first column after insertioncount (
int) – Number of columns to be inserteddescription (
str) – Command description
-
class
commands.InsertRows(grid, model, index, row, count, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandInserts grid rows
- Parameters
grid (
QTableView) – The main grid objectmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Parent into which the new rows are insertedrow (
int) – Row number that first row will have after insertioncount (
int) – Number of rows to be inserteddescription (
str) – Command description
-
class
commands.InsertTable(grid, model, table, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandInserts table
- Parameters
-
class
commands.MakeButtonCell(grid, text, index, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandMakes a button cell
- Parameters
-
class
commands.RemoveButtonCell(grid, index, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandRemoves a button cell
- Parameters
grid (
QTableView) – Main grid objectindex (
QModelIndex) – Index of the cell where a button cell is removeddescription (
str) – Command description
-
class
commands.SetCellCode(code, model, index, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandSets cell code in grid
- Parameters
-
class
commands.SetCellFormat(attr, model, index, selected_idx, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandSets cell format in grid
Format is set for one given cell and a selection.
- Parameters
attr (
CellAttribute) – Cell format to be setmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Index of the cell for which the format is setselected_idx (
Iterable[QModelIndex]) – Indexes of cells for which the format is setdescription (
str) – Command description
-
class
commands.SetCellMerge(attr, model, index, selected_idx, description)[source]¶ Bases:
commands.SetCellFormatSets cell merges in grid
- Parameters
attr (
CellAttribute) – Cell format to be setmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Index of the cell for which the format is setselected_idx (
Iterable[QModelIndex]) – Indexes of cells for which the format is setdescription (
str) – Command description
-
class
commands.SetCellRenderer(attr, model, entry_line, highlighter_document, index, selected_idx, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandSets cell renderer in grid
Adjusts syntax highlighting in entry line.
- Parameters
attr (
CellAttribute) – Cell format that cointains traget renderer informationmodel (
QAbstractTableModel) – Model of the grid objectentry_line (
QPlainTextEdit) – Entry line in main windowhighlighter_document (
QTextDocument) – Document for entry lineindex (
QModelIndex) – Index of the cell for which the renderer is setselected_idx (
Iterable[QModelIndex]) – Indexes of cells for which the renderer is setdescription (
str) – Command description
-
class
commands.SetCellTextAlignment(attr, model, index, selected_idx, description)[source]¶ Bases:
commands.SetCellFormatSets cell text alignment in grid
- Parameters
attr (
CellAttribute) – Cell format to be setmodel (
QAbstractTableModel) – Model of the grid objectindex (
QModelIndex) – Index of the cell for which the format is setselected_idx (
Iterable[QModelIndex]) – Indexes of cells for which the format is setdescription (
str) – Command description
-
class
commands.SetColumnsWidth(grid, columns, table, old_width, new_width, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandSets column width in grid
- Parameters
-
class
commands.SetGridSize(grid, old_shape, new_shape, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandSets size of grid
- Parameters
-
class
commands.SetRowsHeight(grid, rows, table, old_height, new_height, description)[source]¶ Bases:
PyQt5.QtWidgets.QUndoCommandSets rows height in grid
- Parameters
-
class
commands.ThawCell(model, cells, description)[source]¶ Bases:
commands.FreezeCellThaw (unfreezes) cell in grid
- Parameters
pyspread