Add tooltips to widgets in preferences
@@ -99,7 +99,7 @@ class WidgetBuilder:
return form
def create_widget(
- self, schema: dict, ui_schema: dict, state=None, description = "",
+ self, schema: dict, ui_schema: dict, state=None, description: str = "",
) -> widgets.SchemaWidgetMixin:
schema_type = get_schema_type(schema)
@@ -116,8 +116,12 @@ class WidgetBuilder:
widget_variant = ui_schema.get('ui:widget', default_variant)
widget_cls = self.widget_map[schema_type][widget_variant]
widget = widget_cls(schema, ui_schema, self)
- widget.setDescription(description)
default_state = get_widget_state(schema, state)
if default_state is not None:
widget.state = default_state
+
+ if description:
+ widget.setDescription(description)
+ widget.setToolTip(description)
+
return widget
