Widget

class gpype.frontend.widgets.base.widget.Widget[source]

Bases: object

Base class for main app visualization widgets with automatic updates.

Provides foundation for real-time visualization widgets with automatic UI updates via QTimer and standardized layout structure with grouped content. Wraps content in QGroupBox with configurable layout.

Parameters:
  • widget (QWidget) – The Qt widget to wrap and manage.

  • name (str) – Optional name for the group box title.

  • layout (type[QBoxLayout]) – Layout class for the content area (default: QVBoxLayout).

Subclasses must implement the _update() method.

UPDATE_INTERVAL_MS = 16.67

Update interval for widget refresh in milliseconds (60 FPS)

__init__(widget, name='', layout=PySide6.QtWidgets.QVBoxLayout)[source]

Initialize the widget with layout and timer setup.

Parameters:
  • widget (QWidget) – The Qt widget to wrap and manage.

  • name (str, optional) – Title for the group box. Defaults to “”.

  • layout (type[QBoxLayout], optional) – Layout class for organizing content within the group box. Defaults to QVBoxLayout.

run()[source]

Start the automatic update timer for real-time visualization.

Begins periodic updates at the configured interval (default 60 FPS). Should be called after the widget is fully initialized.

terminate()[source]

Stop the automatic update timer and cleanup resources.

Should be called before the widget is destroyed to ensure proper resource management.