def set_data()

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


    def set_data(self, key: str, value: object):
        """
        Updates the stored data with the new value and emits the data_changed signal.

        Parameters
        ----------
        key : str
            key of the data
        value : object
            new value of the data
        """
        if not hasattr(self, key):
            if not self.current_wall:
                return

            if not hasattr(self.current_wall, key):
                raise AttributeError(f"ProjectSettingsModel has no attribute {key}")
            setattr(self.current_wall, key, value)
        else:
            setattr(self, key, value)
        self.data_changed.emit(key, value)

        # Because we do not allow the user to set the target nits if working outside of PQ, we add special handling to
        # reflect these changes in the UI
        if self.current_wall:
            if key == constants.LedWallSettingsKeys.TARGET_EOTF or constants.LedWallSettingsKeys.TARGET_MAX_LUM_NITS:
                self.data_changed.emit(
                    constants.LedWallSettingsKeys.TARGET_MAX_LUM_NITS, self.current_wall.target_max_lum_nits)

        # If the input plate gamut changes then we emit a signal so we can update the
        # preview in the correct colour space
        if key == constants.LedWallSettingsKeys.INPUT_PLATE_GAMUT:
            self.input_plate_gamut_changed.emit()