qudi.util.parameters.ParameterWidgetMapper

class qudi.util.parameters.ParameterWidgetMapper[source]

Bases: builtins.object

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

widget_for_parameter(param)

Tries to determine a suitable QWidget to represent the given parameter.

widget_from_annotation(annotation)

Tries to determine a suitable QWidget to represent values of the given annotation type.

widget_from_value(value)

Tries to determine a suitable QWidget to represent the type of the given value.

widgets_for_callable(func)

Returns QWidget classes for each parameter from the call signature of "func".

classmethod widget_for_parameter(param: Parameter) Type[QWidget] | None[source]

Tries to determine a suitable QWidget to represent the given parameter. If no type annotation is given for a parameter it will try to determine the type from the default value. If no (known) type can be determined, None will be returned.

classmethod widget_from_annotation(annotation: Any) Type[QWidget] | None[source]

Tries to determine a suitable QWidget to represent values of the given annotation type.

classmethod widget_from_value(value: Any) Type[QWidget] | None[source]

Tries to determine a suitable QWidget to represent the type of the given value.

classmethod widgets_for_callable(func: Callable) Dict[str, Type[QWidget] | None][source]

Returns QWidget classes for each parameter from the call signature of “func”. See ParameterWidgetMapper.widget_for_parameter for more information.