TTkGridLayout๐ถ๏ธ
- class TTkGridLayout(*, columnMinWidth: int = 0, rowMinHeight: int = 0, **kwargs)[source]๐ถ๏ธ
Bases:
TTkLayoutThe grid layout allows an automatic place all the widgets in a grid, <br/> the empty rows/cols are resized to the โrowMinHeight,columnMinWidthโ parameters
TTkGridLayout โโ columnMinWidth โโโโโโโโโโโคโโโโโโโโโโคโคโโโโโโโโโโ โ Widget1 โ Widget2 โโ Widget3 โ โ (0,0) โ (0,1) โโ (0,3) โ โโโโโโโโโโโผโโโโโโโโโโผโผโโโโโโโโโโข โ rowMinHeight โโโโโโโโโโโผโโโโโโโโโโผโผโโโโโโโโโโข โ โ Widget4 โ โโ โ โ (2,0) โ โโ โ โโโโโโโโโโโผโโโโโโโโโโผโผโโโโโโโโโโข โ โ โโ Widget5 โ โ โ โโ (3,3) โ โโโโโโโโโโโงโโโโโโโโโโงโงโโโโโโโโโโ
- Parameters:
columnMinWidth (int) โ the minimum width of the column, optional, defaults to 0
rowMinHeight (int) โ the minimum height of the row, optional, defaults to 0
Slots๐ถ๏ธ
Methods๐ถ๏ธ
- getSizes()[source]๐ถ๏ธ
Return cached horizontal and vertical slot sizes.
- Returns:
(horSizes, verSizes)- Return type:
tuple[list, list]
- insertColumn(col)[source]๐ถ๏ธ
Insert an empty column at
coland shift items to the right.- Parameters:
col (int) โ column index where the new column is inserted
- insertRow(row)[source]๐ถ๏ธ
Insert an empty row at
rowand shift items downward.- Parameters:
row (int) โ row index where the new row is inserted
- itemAtPosition(row: int, col: int)[source]๐ถ๏ธ
Return the item occupying
(row, col).Spanned items are returned for any covered cell.
- Parameters:
row (int) โ grid row
col (int) โ grid column
- Returns:
layout item at this position
- Return type:
TTkLayoutItemor None
- maximumColWidth(gridCol: int) int[source]๐ถ๏ธ
Return the maximum width allowed for a column.
- Parameters:
gridCol (int) โ column index
- Returns:
maximum column width
- Return type:
int
- maximumRowHeight(gridRow: int)[source]๐ถ๏ธ
Return the maximum height allowed for a row.
- Parameters:
gridRow (int) โ row index
- Returns:
maximum row height
- Return type:
int
- minimumColWidth(gridCol: int) int[source]๐ถ๏ธ
Return the minimum width required for a column.
- Parameters:
gridCol (int) โ column index
- Returns:
minimum column width
- Return type:
int
- minimumRowHeight(gridRow: int)[source]๐ถ๏ธ
Return the minimum height required for a row.
- Parameters:
gridRow (int) โ row index
- Returns:
minimum row height
- Return type:
int
- setColumnMinWidth(cmw)[source]๐ถ๏ธ
Set the minimum width used for empty columns.
- Parameters:
cmw (int) โ minimum empty-column width
- setRowMinHeight(rmh)[source]๐ถ๏ธ
Set the minimum height used for empty rows.
- Parameters:
rmh (int) โ minimum empty-row height
Methods Inherited from:
TTkLayoutaddItem(item[,ย row,ย col,ย rowspan,ย colspan,ย ...])Add the item to this
TTkGridLayoutaddItems(items[,ย row,ย col,ย rowspan,ย ...])Add the items to this
TTkGridLayoutaddWidget(widget[,ย row,ย col,ย rowspan,ย ...])Add the widget to this
TTkGridLayout, this function usesaddItem()addWidgets(widgets[,ย row,ย col,ย rowspan,ย ...])Add the widgets to this
TTkGridLayout, this function usesaddItem()children()Return the list of direct child layout items.
clear()Remove and detach all items from this layout.
count()Return the number of direct child layout items.
fullWidgetAreaGeometry()Return the bounding geometry that encloses all child items.
insertItem(index,ย item)Insert a single item at
index.insertItems(index,ย items)Insert multiple items at
indexand re-parent them.insertWidget(index,ย widget)Insert a widget at
index.insertWidgets(index,ย widgets)Insert widgets at
index.itemAt(index)Return the item at
indexorNonewhen out of range.iterWidgets([onlyVisible,ย recurse,ย reverse])Iterate over all widgets in the layout.
layoutItemType()Return
TTkK.LayoutItemTypes.LayoutItem.lowerWidget(widget)Lower a widget (and its branch) to the bottom z-order.
parentWidget()Return the widget owning this layout branch.
raiseWidget(widget)Raise a widget (and its branch) to the top z-order.
removeItem(item)Remove a single layout item from the grid.
removeItems(items)Remove multiple layout items and clear their grid cells.
removeWidget(widget)Remove a single widget from the grid.
removeWidgets(widgets)Remove multiple widgets from the grid.
replaceItem(item,ย index)Not implemented for grid layout indexed replacement.
setGeometry(x,ย y,ย w,ย h)Set layout geometry and propagate a layout update when changed.
setParent(parent)Set the parent layout item and propagate parent widget ownership.
update(*args,ย **kwargs)Recompute cell geometry and update child widgets/layouts.
TTkGridLayout Attributes๐ถ๏ธ
|
|
|
|
|
|
|
|
|
|
|
Return child items sorted by z-order. |