retype.layouts

class retype.layouts.RowLayout(parent=None)[source]

Bases: QLayout

addItem(item)[source]

Add an item to the end of this layout

count()[source]

Return number of items in this layout

doLayout(rect, dry_run=False)[source]

Lay out the items in `item_list’ within bounding QRect `rect’. If dry_run, only do the calculations and return the resulting width.

expandingDirections(self) Qt.Orientations[source]
itemAt(index)[source]

Return item at given index (non-destructively)

minimumSize(self) QSize[source]
setGeometry(self, a0: QRect)[source]
sizeHint(self) QSize[source]
takeAt(index)[source]

Remove and return item at given index

class retype.layouts.ShelvesWidget(parent=None, min_cell_width=140, max_cell_width=200, cell_height=140)[source]

Bases: QWidget

A resizable and scrollable widget that uses ShelvesLayout. Use its addWidget() method to add children, setContentsMargins() to set the layout’s margins.

addWidget(widget)[source]
clearWidgets()[source]
setContentsMargins(self, left: int, top: int, right: int, bottom: int)[source]
setContentsMargins(self, margins: QMargins) None

Modules

retype.layouts.rowlayout

PyQt horizontal layout that simply lays out items from left to right based on their size, accounting for spacing and contents margins.

retype.layouts.shelveslayout

PyQt grid layout that is like bookshelves; places each item at the bottom centre of its cell, like a book resting on a shelf.