(self)
Reset the currently selected variable to its original state.
Reset the currently selected variable to its original state.
Reset the currently selected variable to its original state .
def reset_selected(self):
        """Reset the currently selected variable to its original state."""
        ind = self.selected_var_index()
        if ind >= 0:
            model = self.variables_model
            midx = model.index(ind)
            var = midx.data(Qt.EditRole)
            tr = midx.data(TransformRole)
            if not tr:
                return  # nothing to reset
            editor = self._editor
            with disconnected(editor.variable_changed,
                              self._on_variable_changed):
                model.setData(midx, [], TransformRole)
                editor.set_data(var, transform=[])
            self._invalidate()
def reset_selected ( self ) : ind = self . selected_var_index ( ) if ind >= 0 : model = self . variables_model midx = model . index ( ind ) var = midx . data ( Qt . EditRole ) tr = midx . data ( TransformRole ) if not tr : return # nothing to reset editor = self . _editor with disconnected ( editor . variable_changed , self . _on_variable_changed ) : model . setData ( midx , [ ] , TransformRole ) editor . set_data ( var , transform = [ ] ) self . _invalidate ( )