(self, )
Restore the edit transform from saved state.
Restore the edit transform from saved state.
Restore the edit transform from saved state .
def _restore(self, ):
        """
        Restore the edit transform from saved state.
        """
        model = self.variables_model
        for i in range(model.rowCount()):
            midx = model.index(i, 0)
            coldesc = model.data(midx, Qt.EditRole)  # type: DataVector
            tr = self._restore_transform(coldesc.vtype)
            if tr:
                model.setData(midx, tr, TransformRole)

        # Restore the current variable selection
        i = -1
        if self._selected_item is not None:
            for i, vec in enumerate(model):
                if vec.vtype.name_type() == self._selected_item:
                    break
        if i == -1 and model.rowCount():
            i = 0

        if i != -1:
            itemmodels.select_row(self.variables_view, i)
def _restore ( self , ) : model = self . variables_model for i in range ( model . rowCount ( ) ) : midx = model . index ( i , 0 ) coldesc = model . data ( midx , Qt . EditRole ) # type: DataVector tr = self . _restore_transform ( coldesc . vtype ) if tr : model . setData ( midx , tr , TransformRole ) # Restore the current variable selection i = - 1 if self . _selected_item is not None : for i , vec in enumerate ( model ) : if vec . vtype . name_type ( ) == self . _selected_item : break if i == - 1 and model . rowCount ( ) : i = 0 if i != - 1 : itemmodels . select_row ( self . variables_view , i )