TTkLayoutItem๐ŸŒถ๏ธ

class TTkLayoutItem(*, x: int = 0, y: int = 0, z: int = 0, pos: Tuple[int, int] | None = None, width: int = 0, height: int = 0, size: Tuple[int, int] | None = None, row: int = 0, col: int = 0, rowspan: int = 1, colspan: int = 1, maxWidth: int = 65536, maxHeight: int = 65536, maxSize: Tuple[int, int] | None = None, minWidth: int = 0, minHeight: int = 0, minSize: Tuple[int, int] | None = None, **kwargs: Any)[source]๐ŸŒถ๏ธ

Bases: object

TTkLayoutItem is the base class of layout Items inherited by TTkLayout, TTkWidgetItem, and all the derived layout managers.

Parameters:
  • row (int) โ€“ (used only in the TTkGridLayout), the row of the grid, optional, defaults to 0

  • col (int) โ€“ (used only in the TTkGridLayout), the col of the grid, optional, defaults to 0

  • rowspan (int) โ€“ (used only in the TTkGridLayout), the rows used by this, optional, defaults to 1

  • colspan (int) โ€“ (used only in the TTkGridLayout), the cols used by this, optional, defaults to 1

Methods๐ŸŒถ๏ธ

geometry() → Tuple[int, int, int, int][source]๐ŸŒถ๏ธ

Return the item geometry as (x, y, width, height).

layer() → int[source]๐ŸŒถ๏ธ

Return the current layer flag.

layoutItemType() → LayoutItemTypes[source]๐ŸŒถ๏ธ

Return the layout item type.

Deprecated since version 0.50.0: Prefer using isinstance(item, TTkLayout) or isinstance(item, TTkWidgetItem) for type checks.

maxDimension(o: int) → int[source]๐ŸŒถ๏ธ

Return maximum size along an orientation.

Parameters:

o (int) โ€“ orientation constant

Returns:

maximum size for the requested orientation

Return type:

int

maximumHeight() → int[source]๐ŸŒถ๏ธ

Return the maximum allowed height.

maximumHeightSpan(pos: int) → int[source]๐ŸŒถ๏ธ

Return the maximum height contribution for a grid row.

Parameters:

pos (int) โ€“ row index being queried

Returns:

maximum height for this row slice

Return type:

int

maximumSize() → Tuple[int, int][source]๐ŸŒถ๏ธ

Return the maximum size as (width, height).

maximumWidth() → int[source]๐ŸŒถ๏ธ

Return the maximum allowed width.

maximumWidthSpan(pos: int) → int[source]๐ŸŒถ๏ธ

Return the maximum width contribution for a grid column.

Parameters:

pos (int) โ€“ column index being queried

Returns:

maximum width for this column slice

Return type:

int

minDimension(o: int) → int[source]๐ŸŒถ๏ธ

Return minimum size along an orientation.

Parameters:

o (int) โ€“ orientation constant

Returns:

minimum size for the requested orientation

Return type:

int

minimumHeight() → int[source]๐ŸŒถ๏ธ

Return the minimum allowed height.

minimumHeightSpan(pos: int) → int[source]๐ŸŒถ๏ธ

Return the minimum height contribution for a grid row.

Parameters:

pos (int) โ€“ row index being queried

Returns:

minimum height for this row slice

Return type:

int

minimumSize() → Tuple[int, int][source]๐ŸŒถ๏ธ

Return the minimum size as (width, height).

minimumWidth() → int[source]๐ŸŒถ๏ธ

Return the minimum allowed width.

minimumWidthSpan(pos: int) → int[source]๐ŸŒถ๏ธ

Return the minimum width contribution for a grid column.

Parameters:

pos (int) โ€“ column index being queried

Returns:

minimum width for this column slice

Return type:

int

offset() → Tuple[int, int][source]๐ŸŒถ๏ธ

Return the item offset as (xOffset, yOffset).

parent() → TTkLayoutItem | None[source]๐ŸŒถ๏ธ

Return the parent layout item/container.

pos() → Tuple[int, int][source]๐ŸŒถ๏ธ

Return the item position as (x, y).

setGeometry(x: int, y: int, w: int, h: int) → None[source]๐ŸŒถ๏ธ

Set item geometry.

Parameters:
  • x (int) โ€“ horizontal position

  • y (int) โ€“ vertical position

  • w (int) โ€“ width

  • h (int) โ€“ height

setLayer(layer: int) → None[source]๐ŸŒถ๏ธ

Set the layer and update the packed z-order layer bits.

Parameters:

layer (int) โ€“ one of the TTkLayoutItem.LAYER* constants

setOffset(x: int, y: int) → None[source]๐ŸŒถ๏ธ

Set the item offset.

Parameters:
  • x (int) โ€“ horizontal offset

  • y (int) โ€“ vertical offset

setParent(parent: TTkLayoutItem | None) → None[source]๐ŸŒถ๏ธ

Set the parent layout item/container.

Parameters:

parent (object) โ€“ parent object in the layout hierarchy

size() → Tuple[int, int][source]๐ŸŒถ๏ธ

Return the item size as (width, height).

TTkLayoutItem Attributes๐ŸŒถ๏ธ

LAYER0

LAYER1

LAYER2

LAYER3

LAYERMASK