def update_widgets()

in src/open_vp_cal/widgets/project_settings_widget.py [0:0]


    def update_widgets(self, key, widget) -> None:
        """ Updates the widgets with the default values from the model

        Args:
            key: Key of the widget name
            widget: Widget to update
        """
        if isinstance(widget, (QDoubleSpinBox, QSpinBox)):
            if isinstance(widget, QDoubleSpinBox):
                widget.setDecimals(self.model.default_data[key]["decimals"])
            widget.setMinimum(self.model.default_data[key]["min"])
            widget.setMaximum(self.model.default_data[key]["max"])
            widget.setSingleStep(self.model.default_data[key]["step"])
            widget.setValue(self.model.default_data[key][constants.DEFAULT])
        if isinstance(widget, QComboBox) and key in self.model.default_data:
            options = self.model.default_data[key][constants.OPTIONS]
            if callable(options):
                options = options()
            options = [str(option) for option in options]
            widget.addItems(options)
            widget.setCurrentText(str(self.model.default_data[key][constants.DEFAULT]))
        if isinstance(widget, QCheckBox) and key in self.model.default_data:
            widget.setChecked(self.model.default_data[key][constants.DEFAULT])
        if isinstance(widget, QLineEdit) and key in self.model.default_data:
            widget.setText(self.model.default_data[key][constants.DEFAULT])