edifice.TableGridView

edifice.TableGridView#

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

Bases: QtWidgetElement

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 the row Element returned by the row() method. The row() Element establishes a row in the table, and may have children of any type of Element.

Example:

with TableGridView() as tgv:
    with tgv.row():
        Label(text="row 0 column 0")
        Label(text="row 0 column 1")
    with tgv.row():
        Label(text="row 1 column 0")
        with ButtonView():
            Label(text="row 1 column 1")
Parameters:
  • row_stretch (list[int]) – nth row stretch size in proportion to the nth int in this list. See setRowStretch

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

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

  • column_minwidth (list[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.

row()

Returns an Element that represents a new row in this TableGridView.

set_key(key)

Sets the key of the 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.

row()[source]#

Returns an Element that represents a new row in this TableGridView. Each child of the new row element will be rendered in columns aligned with the other rows.

Return type:

Element