More hints#

Widget icons#

qtawesome is a great library to get access to a large collection of icons. Silx already depends on it. Consider using if you want to have a nice icon for your widget without creating your own.

See qtawesome usage examples.

More usage of the pydantic models#

Retrieving pydantic model fields default values#

Remember that your pydantic models can contain default values.

class InputModel(BaseInputModel):
    percentiles: tuple[float, float] = Field(default=(0, 100), description="percentiles to use for rescaling, must be a tuple of two values (p_min, p_max) with p_min <= p_max")

To avoid duplicating this information on the “gui” module you can retrieve those values like:

default_value = InputModel.model_fields.get("percentiles").default.value