TTkTableWidget🌢️

class TTkTableWidget(*, tableModel: TTkAbstractTableModel = None, vSeparator: bool = True, hSeparator: bool = True, vHeader: bool = True, hHeader: bool = True, sortingEnabled=False, dataPadding=1, **kwargs)[source]🌢️

Bases: TTkAbstractScrollView

A TTkTableWidget implements a table view that displays items from a model.

    Customer Id     β•ΏFirst Name β•ΏLast Name   β•ΏCompany                         β•ΏCity                β•Ώ
1  β”‚DD37Cf93aecA6Dc β”‚Sheryl     β”‚Baxter      β”‚Rasmussen Group                 β”‚East Leonard        β”‚
β•Ύβ•Œβ•Œβ”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
2  β”‚1Ef7b82A4CAAD10 β”‚Preston    β”‚Lozano      β”‚Vega-Gentry                     β”‚East Jimmychester   β”‚
β•Ύβ•Œβ•Œβ”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
3  β”‚6F94879bDAfE5a6 β”‚Roy        β”‚Berry       β”‚Murillo-Perry                   β”‚Isabelborough       β”‚
β•Ύβ•Œβ•Œβ”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
4  β”‚5Cef8BFA16c5e3c β”‚Linda      β”‚Olsen       β”‚Dominguez, Mcmillan and Donovan β”‚Bensonview          β”‚
β•Ύβ•Œβ•Œβ”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
5  β”‚053d585Ab6b3159 β”‚Joanna     β”‚Bender      β”‚Martin, Lang and Andrade        β”‚West Priscilla      β”‚
β•Ύβ•Œβ•Œβ”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
6  β”‚2d08FB17EE273F4 β”‚Aimee      β”‚Downs       β”‚Steele Group                    β”‚Chavezborough       β”‚
β•Ύβ•Œβ•Œβ”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The TTkTableWidget class is one of the Model/View Classes and is part of TermTk’s model/view framework.

TTkTableWidget implements the methods to allow it to display data provided by models derived from the TTkAbstractTableModel class.

Navigation

You can navigate the cells in the table by clicking on a cell with the mouse, or by using the arrow keys, you can also hit Tab and Backtab to move from cell to cell.

Visual Appearance

The table has a vertical header that can be obtained using the verticalHeader() function, and a horizontal header that is available through the horizontalHeader() function. The height of each row in the table can be set using setRowHeight(); similarly, the width of columns can be set using setColumnWidth().

They can be selected with selectRow() and selectColumn(). The table will show a grid depending on the setHSeparatorVisibility() setVSeparatorVisibility() methods.

The items shown in a table view, like those in the other item views, are rendered and edited using standard delegates. However, for some tasks it is sometimes useful to be able to insert widgets in a table instead. Widgets are set for particular indexes with the setIndexWidget() function, and later retrieved with indexWidget().

By default, the cells in a table do not expand to fill the available space. You can make the cells fill the available space by stretching the last header section.

To distribute the available space according to the space requirement of each column or row, call the view’s resizeColumnsToContents() or resizeRowsToContents() functions.

Parameters:
  • tableModel (TTkAbstractTableModel) – the model for the view to present.

  • vSeparator (bool, optional) – show the vertical separators, defaults to True

  • hSeparator (bool, optional) – show the horizontal separators, defaults to True

  • vHeader (bool, optional) – show the vertical header, defaults to True

  • hHeader (bool, optional) – show the horizontal header, defaults to True

  • sortingEnabled (bool, optional) – enable the column sorting, defaults to False

  • dataPadding (int, optional) – the right column padding, defaults to 1

TTkContainer’s inherited init params:

Parameters:
  • layout (TermTk.TTkLayouts) – the layout of this widget, optional, defaults to TTkLayout

  • padding (TTkPadding) – the padding (top, bottom, left, right) of the widget, defaults to (0,0,0,0)

  • paddingTop (int) – the Top padding, override Top padding if already defined, optional, default=0 if padding is not defined

  • paddingBottom (int) – the Bottom padding, override Bottom padding if already defined, optional, default=0 if padding is not defined

  • paddingLeft (int) – the Left padding, override Left padding if already defined, optional, default=0 if padding is not defined

  • paddingRight (int) – the Right padding, override Right padding if already defined, optional, default=0 if padding is not defined

  • forwardStyle (bool) – [Experimental] any change of style will reflect the children, defaults to False

TTkWidget’s inherited init params:

Parameters:
  • name (str, optional) – the name of the widget, defaults to β€œβ€

  • parent (TTkWidget, optional) – the parent widget, defaults to None

  • x (int, optional) – the x position, defaults to 0

  • y (int, optional) – the y position, defaults to 0

  • pos ((int,int), optional) – the [x,y] position (override the previously defined x, y), defaults to (x,y)

  • width (int, optional) – the width of the widget, defaults to 0

  • height (int, optional) – the height of the widget, defaults to 0

  • size ((int,int), optional) – the size [width, height] of the widget (override the previously defined sizes), defaults to (width,height)

  • maxWidth (int, optional) – the maxWidth of the widget, defaults to 0x10000

  • maxHeight (int, optional) – the maxHeight of the widget, defaults to 0x10000

  • maxSize ((int,int), optional) – the max [width,height] of the widget, optional, defaults to (maxWidth,maxHeight)

  • minWidth (int, optional) – the minWidth of the widget, defaults to 0

  • minHeight (int, optional) – the minHeight of the widget, defaults to 0

  • minSize ((int,int), optional) – the minSize [width,height] of the widget, optional, defaults to (minWidth,minHeight)

  • toolTip (TTkString, optional) – This property holds the widget’s tooltip, defaults to β€˜β€™

  • style (dict, optional) – this field hold the custom style to be used by this widget

  • addStyle (dict, optional) – this field is required to override/merge the new style on top of the current one, useful if only few params need to be changed

  • visible (bool, optional) – the visibility, optional, defaults to True

  • enabled (bool, optional) – the ability to handle input events, optional, defaults to True

Style🌢️

classStyle = {
            'default':     {
                'color':          TTkColor.RST,
                'lineColor':      TTkColor.fg("#444444"),
                'headerColor':    TTkColor.fg("#FFFFFF")+TTkColor.bg("#444444")+TTkColor.BOLD,
                'hoverColor':     TTkColor.fg("#FFFF00")+TTkColor.bg("#0088AA")+TTkColor.BOLD,
                'currentColor':   TTkColor.fg("#FFFF00")+TTkColor.bg("#0088FF")+TTkColor.BOLD,
                'selectedColor':  TTkColor.bg("#0066AA"),
                'separatorColor': TTkColor.fg("#555555")+TTkColor.bg("#444444")},
            'disabled':    {
                'color':          TTkColor.fg("#888888"),
                'lineColor':      TTkColor.fg("#888888"),
                'headerColor':    TTkColor.fg("#888888"),
                'hoverColor':     TTkColor.bg("#888888"),
                'currentColor':   TTkColor.bg("#888888"),
                'selectedColor':  TTkColor.fg("#888888"),
                'separatorColor': TTkColor.fg("#888888")},
        }

Signals🌢️

cellChanged

This signal is emitted whenever the data of the item in the cell specified by row and column has changed.

cellClicked

This signal is emitted whenever a cell in the table is clicked.

cellDoubleClicked

This signal is emitted whenever a cell in the table is double clicked.

cellEntered

This signal is emitted when the mouse cursor enters a cell.

closed

This signal is emitted whenever the widget is closed

currentCellChanged

This signal is emitted whenever the current cell changes.

currentStyleChanged

This signal is emitted whenever the widget stye change

focusChanged

This signal is emitted whenever the focus status change i.e. with the setFocus() or clearFocus() methods.

sizeChanged

This signal is emitted whenever the widget size change

viewChanged

This signal is emitted whenever there is a change in the view content topology (size,pos)

viewMovedTo

This signal is emitted when the view content move to a new position (x,y),

viewSizeChanged

This signal is emitted when the view content size changed

Slots🌢️

copy()

Copies any selected cells to the clipboard.

cut()

Copies the selected ccells to the clipboard and deletes them from the table.

paste()

Pastes the text/cells from the clipboard into the table at the current cursor position.

redo()

Redoes the last operation if redo is available.

resizeColumnToContents(column)

Resizes the given column based on the size hints of the delegate used to render each item in the column.

resizeColumnsToContents()

Resizes all columns based on the size hints of the delegate used to render each item in the columns.

resizeRowToContents(row)

Resizes the given row based on the size hints of the delegate used to render each item in the row.

resizeRowsToContents()

Resizes all rows based on the size hints of the delegate used to render each item in the rows.

setColumnWidth(column,Β width)

Sets the width of the given column.

setRowHeight(row,Β height)

Sets the height of the given row.

setSortingEnabled(enable)

If enable is true, enables sorting for the table and immediately trigger a call to sortByColumn() with the current sort section and order

sortByColumn(column,Β order)

Sorts the model by the values in the given column and order.

undo()

Undoes the last operation if undo is available.

Slots Inherited from: TTkAbstractScrollView

viewMoveTo(x,Β y)

This method is used to set the vertical and horizontal offsets of the TTkAbstractScrollViewInterface

Slots Inherited from: TTkContainer

hide()

hide the widget

show()

show the widget

Slots Inherited from: TTkWidget

close()

Close (Destroy/Remove) the widget

hide()

hide the widget

lowerWidget()

Lower the Widget below its relatives

raiseWidget([raiseParent])

Raise the Widget above its relatives

setDisabled([disabled])

This property holds whether the widget is disnabled

setEnabled([enabled])

This property holds whether the widget is enabled

setFocus()

Focus the widget

setVisible(visible)

Set the visibility status of this widget

show()

show the widget

update([repaint,Β updateLayout,Β updateParent])

Notify the drawing routine that the widget changed and needs to draw its new content.

Members🌢️

cellChanged: pyTTkSignal🌢️

This signal is emitted whenever the data of the item in the cell specified by row and column has changed.

Parameters:
  • row (int) – the row

  • col (int) – the column

cellClicked: pyTTkSignal🌢️

This signal is emitted whenever a cell in the table is clicked. The row and column specified is the cell that was clicked.

Parameters:
  • row (int) – the row

  • col (int) – the column

cellDoubleClicked: pyTTkSignal🌢️

This signal is emitted whenever a cell in the table is double clicked. The row and column specified is the cell that was double clicked.

Parameters:
  • row (int) – the row

  • col (int) – the column

cellEntered: pyTTkSignal🌢️

This signal is emitted when the mouse cursor enters a cell. The cell is specified by row and column.

Parameters:
  • row (int) – the row

  • col (int) – the column

closed: pyTTkSignal🌢️

This signal is emitted whenever the widget is closed

Parameters:

widget (TTkWidget) – the widget closed (=self)

currentCellChanged: pyTTkSignal🌢️

This signal is emitted whenever the current cell changes. The cell specified by prevRow and prevCol is the cell that previously had the focus, the cell specified by currRow and currCol is the new current cell.

Parameters:
  • currRow (int) – the current row

  • currColumn (int) – the current column

  • prevRow (int) – the previous row

  • prevCol (int) – the previous column

currentStyleChanged: pyTTkSignal🌢️

This signal is emitted whenever the widget stye change

Parameters:

style (dict) – the new style applied

focusChanged: pyTTkSignal🌢️

This signal is emitted whenever the focus status change i.e. with the setFocus() or clearFocus() methods

Parameters:

status (bool) – the curent focus status

sizeChanged: pyTTkSignal🌢️

This signal is emitted whenever the widget size change

Parameters:
  • width (int) – the new widget width

  • height (int) – the new widget height

viewChanged: pyTTkSignal🌢️

This signal is emitted whenever there is a change in the view content topology (size,pos)

Note

This signal must be implemented in any implementation of TTkAbstractScrollView to notify that the view content boudaries changed

viewMovedTo: pyTTkSignal🌢️

This signal is emitted when the view content move to a new position (x,y),

Parameters:
  • x (int) – the new horizontal offset

  • y (int) – the new vertical offset

viewSizeChanged: pyTTkSignal🌢️

This signal is emitted when the view content size changed

Parameters:
  • width (int) – the new width

  • height (int) – the new heighht

Methods🌢️

clearSelection() None[source]🌢️

Deselects all selected items. The current index will not be changed.

columnCount() int[source]🌢️

Returns the number of columns.

Returns:

int

copy() None[source]🌢️

Copies any selected cells to the clipboard.

currentColumn() int[source]🌢️

Returns the column of the current item.

Returns:

int

currentRow() int[source]🌢️

Returns the row of the current item.

Returns:

int

cut() None[source]🌢️

Copies the selected ccells to the clipboard and deletes them from the table.

hSeparatorVisibility() bool[source]🌢️

Returns the visibility status of the horizontal separator

Returns:

bool

horizontalHeader() TTkHeaderView[source]🌢️

Returns the table view’s horizontal header.

Returns:

TTkHeaderView

isRedoAvailable() bool[source]🌢️
Returns:

bool

isSortingEnabled() bool[source]🌢️

This property holds whether sorting is enabled If this property is true, sorting is enabled for the table. If this property is false, sorting is not enabled. The default value is false.

Note: . Setting the property to true with setSortingEnabled() immediately triggers a call to sortByColumn() with the current sort section and order.

Returns:

bool

isUndoAvailable() bool[source]🌢️
Returns:

bool

model() TTkAbstractTableModel[source]🌢️

Returns the model that this view is presenting.

Returns:

TTkAbstractTableModel

paste() None[source]🌢️

Pastes the text/cells from the clipboard into the table at the current cursor position.

redo() None[source]🌢️

Redoes the last operation if redo is available.

resizeColumnToContents(column: int) None[source]🌢️

Resizes the given column based on the size hints of the delegate used to render each item in the column.

Parameters:

column (int) – the column to be resized

resizeColumnsToContents() None[source]🌢️

Resizes all columns based on the size hints of the delegate used to render each item in the columns.

resizeRowToContents(row: int) None[source]🌢️

Resizes the given row based on the size hints of the delegate used to render each item in the row.

Parameters:

row (int) – the row to be resized

resizeRowsToContents() None[source]🌢️

Resizes all rows based on the size hints of the delegate used to render each item in the rows.

rowCount() int[source]🌢️

Returns the number of rows.

Returns:

int

selectAll() None[source]🌢️

Selects all items in the view. This function will use the selection behavior set on the view when selecting.

selectColumn(col: int) None[source]🌢️

Selects the given column in the table view

Parameters:

col (int) – the column to be selected

selectRow(row: int) None[source]🌢️

Selects the given row in the table view

Parameters:

row (int) – the row to be selected

setColumnWidth(column: int, width: int) None[source]🌢️

Sets the width of the given column.

Parameters:
  • column (int) – the column

  • width (int) – its width

setHSeparatorVisibility(visibility: bool) None[source]🌢️

Set the the visibility of the horizontal separators (lines)

     Customer Id      First Name  Last Name   Company
1  β”‚ DD37Cf93aecA6Dc  Sheryl      Baxter      Rasmussen Group
β•Ύβ•Œβ•Œβ”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
2  β”‚ 1Ef7b82A4CAAD10  Preston     Lozano      Vega-Gentry
β•Ύβ•Œβ•Œβ”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
3  β”‚ 6F94879bDAfE5a6  Roy         Berry       Murillo-Perry
β•Ύβ•Œβ•Œβ”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
Parameters:

visibility (bool) – the visibility status

setModel(model: TTkAbstractTableModel) None[source]🌢️

Sets the model for the view to present.

Parameters:

model (TTkAbstractTableModel)

setRowHeight(row: int, height: int) None[source]🌢️

Sets the height of the given row.

Parameters:
  • row (int) – the row

  • height (int) – its height

setSelection(pos: tuple[int, int], size: tuple[int, int], flags: TTkItemSelectionModel) None[source]🌢️

Selects the items within the given rect and in accordance with the specified selection flags.

Parameters:
  • pos (tuple[int,int]) – the x,y position of the rect

  • size (tuple[int,int]) – the width,height of the rect used for the selection

  • flags (TTkItemSelectionModel) – the selection model used (i.e. TTkItemSelectionModel.Select)

setSortingEnabled(enable: bool) None[source]🌢️

If enable is true, enables sorting for the table and immediately trigger a call to sortByColumn() with the current sort section and order

Note: Setter function for property sortingEnabled.

Parameters:

enable (bool) – the availability of undo

setVSeparatorVisibility(visibility: bool)[source]🌢️

Set the the visibility of the vertical separators (lines)

     Customer Id     β•ΏFirst Name β•ΏLast Name   β•ΏCompany                     β•Ώ
1  β”‚ DD37Cf93aecA6Dc β”‚Sheryl     β”‚Baxter      β”‚Rasmussen Group             β”‚
2  β”‚ 1Ef7b82A4CAAD10 β”‚Preston    β”‚Lozano      β”‚Vega-Gentry                 β”‚
3  β”‚ 6F94879bDAfE5a6 β”‚Roy        β”‚Berry       β”‚Murillo-Perry               β”‚
4  β”‚ 5Cef8BFA16c5e3c β”‚Linda      β”‚Olsen       β”‚Dominguez, Mcmillan and Don β”‚
5  β”‚ 053d585Ab6b3159 β”‚Joanna     β”‚Bender      β”‚Martin, Lang and Andrade    β”‚
6  β”‚ 2d08FB17EE273F4 β”‚Aimee      β”‚Downs       β”‚Steele Group                β”‚
Parameters:

visibility (bool) – the visibility status

sortByColumn(column: int, order: SortOrder) None[source]🌢️

Sorts the model by the values in the given column and order.

column may be -1, in which case no sort indicator will be shown and the model will return to its natural, unsorted order. Note that not all models support this and may even crash in this case.

Parameters:
  • column (bool) – the column used for the sorting, -1 to keep the table unsorted

  • order (TTkK.SortOrder) – the sort order

undo() None[source]🌢️

Undoes the last operation if undo is available.

unselectColumn(column: int) None[source]🌢️

Unselects the given column in the table view

Parameters:

column (int) – the column to be unselected

unselectRow(row: int) None[source]🌢️

Unselects the given row in the table view

Parameters:

row (int) – the row to be unselected

vSeparatorVisibility() bool[source]🌢️

Returns the visibility status of the vertical separator

Returns:

bool

verticalHeader() TTkHeaderView[source]🌢️

Returns the table view’s vertical header.

Returns:

TTkHeaderView

viewFullAreaSize() tuple[int, int][source]🌢️

This method returns the full widget area size of the TTkAbstractScrollViewInterface implementation.

This is required to TTkAbstractScrollArea implementation to handle the on-demand scroll bars.

Note

Reimplement this function to handle this event

Returns:

the full area size as a tuple of 2 int elements (width,height)

Return type:

tuple[int,int]

Methods Inherited from: TTkAbstractScrollView

getViewOffsets()

Retrieve the vertical and horizontal offsets of the TTkAbstractScrollViewInterface

resizeEvent(w,Β h)

Convenience function, Event Callback triggered after a successful resize

update([repaint,Β updateLayout,Β updateParent])

Notify the drawing routine that the widget changed and needs to draw its new content.

viewDisplayedSize()

This method returns the displayed size of the TTkAbstractScrollViewInterface implementation.

viewMoveTo(x,Β y)

This method is used to set the vertical and horizontal offsets of the TTkAbstractScrollViewInterface

wheelEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse wheel events for the widget.

Methods Inherited from: TTkContainer

addWidget(widget)

getPadding()

Retrieve the TTkContainer's paddings sizes as shown in Layout Topology

getWidgetByName(name)

Return the widget from its name.

hide()

hide the widget

layout()

Get the Layout

maximumHeight()

maximumWidth()

minimumHeight()

minimumWidth()

mouseEvent(evt)

paintChildCanvas()

removeWidget(widget)

rootLayout()

This is a root layout mainly used to place items that are not supposed to be inside the main layout (i.e. the menu elements).

setCurrentStyle(*args,Β **kwargs)

setLayout(layout)

Set the Layout used by this widget to place all the child widgets.

setPadding(top,Β bottom,Β left,Β right)

Set the TTkContainer's paddings sizes as shown in Layout Topology

show()

show the widget

update([repaint,Β updateLayout,Β updateParent])

Notify the drawing routine that the widget changed and needs to draw its new content.

Methods Inherited from: TTkWidget

clearFocus()

Remove the Focus state of this widget

close()

Close (Destroy/Remove) the widget

currentStyle()

disableWidgetCursor([disable])

enableWidgetCursor([enable])

focusInEvent()

focusOutEvent()

focusPolicy()

geometry()

getCanvas()

getPixmap()

Convenience function which return a pixmap representing the current widget status

getWidgetByName(name)

Return the widget from its name.

hasFocus()

This property holds the focus status of this widget

height()

hide()

hide the widget

isEnabled()

This property holds whether the widget is enabled

isEntered()

isVisible()

Retrieve the visibility status of this widget

isVisibleAndParent()

lowerWidget()

Lower the Widget below its relatives

maxDimension(orientation)

maximumHeight()

maximumSize()

maximumWidth()

mergeStyle(style)

minDimension(orientation)

minimumHeight()

minimumSize()

minimumWidth()

mouseEvent(evt)

move(x,Β y)

Move the widget

moveEvent(x,Β y)

Convenience function, Event Callback triggered after a successful move

name()

paintChildCanvas()

paintEvent(canvas)

Paint Event callback, this need to be overridden in the widget.

parentWidget()

pasteEvent(data)

Callback triggered when a paste event is forwarded to this widget.

pos()

raiseWidget([raiseParent])

Raise the Widget above its relatives

resize(width,Β height)

Resize the widget

resizeEvent(w,Β h)

Convenience function, Event Callback triggered after a successful resize

setCurrentStyle(*args,Β **kwargs)

setDefaultSize(arg,Β width,Β height)

setDisabled([disabled])

This property holds whether the widget is disnabled

setEnabled([enabled])

This property holds whether the widget is enabled

setFocus()

Focus the widget

setFocusPolicy(policy)

This property holds the way the widget accepts keyboard focus

setGeometry(x,Β y,Β width,Β height)

Resize and move the widget

setMaximumHeight(maxh)

setMaximumSize(maxw,Β maxh)

setMaximumWidth(maxw)

setMinimumHeight(minh)

setMinimumSize(minw,Β minh)

setMinimumWidth(minw)

setName(name)

Set the name of this Instance

setParent(parent)

setStyle([style])

setToolTip(toolTip)

setVisible(visible)

Set the visibility status of this widget

setWidgetCursor([pos,Β type])

show()

show the widget

size()

style()

toolTip()

update([repaint,Β updateLayout,Β updateParent])

Notify the drawing routine that the widget changed and needs to draw its new content.

widgetItem()

width()

x()

y()

Methods Inherited from: TMouseEvents

enterEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse enter events for the widget.

leaveEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse leave events for the widget.

mouseDoubleClickEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse click events for the widget.

mouseDragEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse drag events for the widget.

mouseMoveEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse move events for the widget.

mousePressEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse press events for the widget.

mouseReleaseEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse release events for the widget.

mouseTapEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse click events for the widget.

wheelEvent(evt)

This event handler, can be reimplemented in a subclass to receive mouse wheel events for the widget.

Methods Inherited from: TKeyEvents

keyEvent(evt)

This event handler, can be reimplemented in a subclass to receive key events for the widget.

Methods Inherited from: TDragEvents

dragEnterEvent(evt)

This event handler, can be reimplemented in a subclass to receive drag events for the widget.

dragLeaveEvent(evt)

This event handler, can be reimplemented in a subclass to receive drag events for the widget.

dragMoveEvent(evt)

This event handler, can be reimplemented in a subclass to receive drag events for the widget.

dropEvent(evt)

This event handler, can be reimplemented in a subclass to receive drag events for the widget.

TTkTableWidget Attributes🌢️

classStyle

default style