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.
Underlying Qt Layout QGridLayout
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 aTableGridView
is the row Element returned by therow()
method. Therow()
Element establishes a row in the table, and may have children of any type ofElement
.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 nthint
in this list. See setRowStretchcolumn_stretch (
list
[int
]) – nth column stretch size in proportion to the nthint
in this list. See setColumnStretchrow_minheight (
list
[int
]) – nth row minimum height is the nthint
in this list. See setRowMinimumHeightcolumn_minwidth (
list
[int
]) – nth column minimum width is the nthint
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 thisTableGridView
.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 thisTableGridView
. Each child of the new row element will be rendered in columns aligned with the other rows.- Return type: