Skip to content

GUI Helpers

Helper functions for Qt GUI elements.

Functions:

Name Description
get_qt_classname

Get the class name of a QObject.

set_qt_name

Initialize a widget with a given object name.

set_qt_tips

Set the tooltip and status tip for a widget.

get_widget_value

Retrieve the value of a widget based on its type.

set_widget_value

Set the value of a widget based on its type.

iter_custom_widget

Iterate over valid child widgets.

get_qt_classname(obj: QObject) -> str

Get the class name of a QObject.

set_qt_name(w: QWidget | QAction, name: str) -> None

Initialize a widget with a given object name.

set_qt_tips(w: QWidget | QAction, tooltip: str, statustip: str = '') -> None

Set the tooltip and status tip for a widget.

get_widget_value(widget: QWidget) -> Any

Retrieve the value of a widget based on its type.

Parameters:

Name Type Description Default
widget QWidget

The widget to retrieve the value from.

required

Returns:

Name Type Description
Any Any

The value of the widget, or None if not applicable.

set_widget_value(widget: QWidget, val: Any) -> None

Set the value of a widget based on its type.

Parameters:

Name Type Description Default
widget QWidget

The widget to set the value for.

required
val Any

The value to set.

required

iter_custom_widget(w: QWidget) -> Iterator[tuple[str, QWidget]]

Iterate over valid child widgets.