naturtag.widgets.layouts module

Source: * https://doc.qt.io/qtforpython/examples/example_widgets_layouts_flowlayout.html * Many hours of frustration

class naturtag.widgets.layouts.CollapsiblePanel(content_width=400)

Bases: WidgetMixin, QWidget

A widget with a content area and a narrow toggle strip that collapses/expands it.

Subclasses should add their UI to self.content_layout (a VerticalLayout).

staticMetaObject = PySide6.QtCore.QMetaObject("CollapsiblePanel" inherits "QWidget": )
toggle()

Toggle between expanded and collapsed states

class naturtag.widgets.layouts.FlowLayout(parent=None, spacing=0)

Bases: LayoutMixin, QLayout

addItem(item)
count()
expandingDirections()
hasHeightForWidth()
heightForWidth(width)
itemAt(index)
Return type:

Optional[QWidget]

maximumSize()
minimumSize()
preferredSize(constraint=None)
setGeometry(rect)
setSpacing(value)
sizeHint(which=None, constraint=None)
spacing()
Return type:

float

staticMetaObject = PySide6.QtCore.QMetaObject("FlowLayout" inherits "QLayout": )
takeAt(index)
Return type:

Optional[QWidget]

class naturtag.widgets.layouts.GridLayout(parent=None, n_columns=None)

Bases: LayoutMixin, QGridLayout

Simple layout with a grid of widgets

addWidget(item)
clear()
staticMetaObject = PySide6.QtCore.QMetaObject("GridLayout" inherits "QGridLayout": )
class naturtag.widgets.layouts.GroupBoxLayout(name=None)

Bases: QVBoxLayout

GroupBox with a default layout

clear()
set_title(title)
staticMetaObject = PySide6.QtCore.QMetaObject("GroupBoxLayout" inherits "QVBoxLayout": )
class naturtag.widgets.layouts.GroupMixin

Bases: object

add_group(name, parent=None, width=None, min_width=None, max_width=None, policy_min_height=True)

Add a new groupbox to the widget or layout

Return type:

GroupBoxLayout

class naturtag.widgets.layouts.HorizontalLayout

Bases: LayoutMixin, QHBoxLayout

staticMetaObject = PySide6.QtCore.QMetaObject("HorizontalLayout" inherits "QHBoxLayout": )
class naturtag.widgets.layouts.LayoutMixin

Bases: GroupMixin, ShortcutMixin, object

Layout mixin with some extra convenience methods

clear()
property widgets: Iterator[QWidget]
class naturtag.widgets.layouts.ScrollableGridArea(n_columns, item_width, spacing=5, parent=None)

Bases: QScrollArea

A scrollable area containing a GridLayout

addWidget(widget)
clear()
staticMetaObject = PySide6.QtCore.QMetaObject("ScrollableGridArea" inherits "QScrollArea": )
class naturtag.widgets.layouts.ShortcutMixin

Bases: object

add_shortcut(key_sequence, callback)

Add a keyboard shortcut to the widget or layout

Return type:

QShortcut

class naturtag.widgets.layouts.StylableWidget

Bases: WidgetMixin, QWidget

staticMetaObject = PySide6.QtCore.QMetaObject("StylableWidget" inherits "QWidget": )
class naturtag.widgets.layouts.StyleMixin

Bases: object

paintEvent(event)

Allow custom widgets to be styled with QSS

class naturtag.widgets.layouts.VerticalLayout

Bases: LayoutMixin, QVBoxLayout

staticMetaObject = PySide6.QtCore.QMetaObject("VerticalLayout" inherits "QVBoxLayout": )
class naturtag.widgets.layouts.WidgetMixin

Bases: GroupMixin, StyleMixin, ShortcutMixin

Layout mixin with some extra convenience methods