edifice.TableGridView#

class edifice.TableGridView(row_stretch=(), column_stretch=(), row_minheight=(), column_minwidth=(), **kwargs)[source]#

Bases: QtWidgetElement[QWidget]

Table-style grid layout displays its children as aligned rows of columns.

This component has similar behavior to an HTML table. Each column will be the width of its widest child. Each row will be the height of its tallest child.

The only type of child Element allowed in a TableGridView is TableGridRow. Each TableGridRow establishes a row in the table, and may have children of any type of Element.

with TableGridView():
    with TableGridRow():
        Label(text="row 0 column 0")
        Label(text="row 0 column 1")
    with TableGridRow():
        Label(text="row 1 column 0")
        with VBoxView():
            Label(text="row 1 column 1")

If the TableGridRow s are added and removed dynamically then it’s a good idea to Element.set_key() each row.

Parameters:
  • row_stretch (tuple[int, ...]) – nth row stretch size in proportion to the nth int in this list. See setRowStretch

  • column_stretch (tuple[int, ...]) – nth column stretch size in proportion to the nth int in this list. See setColumnStretch

  • row_minheight (tuple[int, ...]) – nth row minimum height is the nth int in this list. See setRowMinimumHeight

  • column_minwidth (tuple[int, ...]) – nth column minimum width is the nth int in this list. See setColumnMinimumWidth

Methods

__init__([row_stretch, column_stretch, ...])

register_ref(reference)

Registers provided Reference to this Element.

set_key(key)

Set the key of an Element.

Attributes

children

The children of this Element.

props

The props of this Element.

underlying

The underlying QWidget, which may not exist if this Element has not rendered.