Collapsible Panel
app.ui.qt.widgets.collapsible_panelModule for collapsible panel; implements the Qt presentation components.
See Also
create_vbox_layout— builds the panel's content layoutRightControlPanel— embeds collapsible control sections
Layer: Presentation. Context: Implements the qt presentation components at this architectural boundary.
CollapsiblePanel
Bases: QWidget
A custom widget that provides a collapsible panel. Clicking the toggle button shows/hides the child widgets.
| PARAMETER | DESCRIPTION |
|---|---|
title
|
Text displayed in the panel's header.
TYPE:
|
parent
|
Optional Qt parent object.
TYPE:
|
content_area: QWidget = QWidget()
instance-attribute
content_layout: QVBoxLayout = create_vbox_layout(self.content_area, margins=(4, 1, 4, 2), spacing=2)
instance-attribute
is_expanded: bool = True
instance-attribute
toggle_button = QPushButton(f'▼ {self._title}')
instance-attribute
__init__(title: str, parent: QWidget | None = None) -> None
add_layout(layout: QVBoxLayout | QHBoxLayout) -> None
Append a nested layout to the panel's content layout.
| PARAMETER | DESCRIPTION |
|---|---|
layout
|
Layout to place in the collapsible content area.
TYPE:
|
add_widget(widget: QWidget) -> None
Append a widget to the panel's content layout.
| PARAMETER | DESCRIPTION |
|---|---|
widget
|
Widget to place in the collapsible content area.
TYPE:
|
toggle() -> None
Invert the expanded state and update the content visibility and header icon.