class _Gap:
A gap within the layout has a direction and a length. Objects are hold in _Cell.item
properties
Method | __init__ |
Examples |
Instance Variable | grid |
Grid object |
Instance Variable | is_expander |
Do this gap expand ? |
Instance Variable | is_empty |
Is this gap explicitly empty (gap.item == None) ? |
Instance Variable | item |
Object as returned from _gap_item method : None, QLabel or QSpacerItem |
Instance Variable | label |
If instance argument index is given, display a label with its number |
Instance Variable | direction |
Expanding or size direction 'H', 'V', 'vertical', or 'horizontal' |
Instance Variable | length |
Length or size of this gap. Can be None, "expand", or int |
Instance Variable | index |
If integer is given, it will be displayed as a label |
Method | _gap_item |
Create an object at init time representing this gap: None, QLabel or QSpacerItem |
Examples
cell = _Cell( _Gap(...), y=0, x=1, y_span=2, x_span=2 ) # horizontal direction _Gap(grid) # H, explicit empty _Gap(grid, direction="H", length=None) # H, explicit empty _Gap(grid, direction="H", length=0) # H, explicit empty _Gap(grid, direction="H", length=20) # H, sized (yellow) _Gap(grid, direction="H", length="expand") # H, expand (blue) _Gap(grid, direction="H", length="unused") # H, unused (magenta) # horizontal direction is default _Gap(grid, length=None) # H, explicit empty _Gap(grid, length=0) # H, explicit empty _Gap(grid, length=20) # H, sized (yellow) _Gap(grid, length="expand") # H, expand (blue) _Gap(grid, length="unused") # H, unused (magenta) # vertical direction _Gap(grid, direction="V", length=None) # V, explicit empty _Gap(grid, direction="V", length=0) # V, explicit empty _Gap(grid, direction="V", length=20) # V, sized (yellow) _Gap(grid, direction="V", length="expand") # V, expand (blue) _Gap(grid, direction="V", length="unused") # V, unused (magenta) # If given, the index argument is displayed _Gap(grid, length=20, index=0) _Gap(grid, index=20)
Parameters | grid | Grid (type: object) |
direction | "H", "V", "horizontal", "vertical" (type: None or str) | |
length |
| |
index | If given, it will be displayed as a label (type: int) |