'Set the input dataset.'

@Inputs.data
@check_sql_input
def setData(self, data=None):

    self.closeContext()
    self.data = data
    if (self.data is not None):
        descriptors = list(self.descriptors)
        currindex = self.currentIndex
        self.descriptors = []
        self.currentIndex = (-1)
        self.openContext(data)
        if ((descriptors != self.descriptors) or (self.currentIndex != currindex)):
            selmodel = self.featureview.selectionModel()
            selmodel.selectionChanged.disconnect(self._on_selectedVariableChanged)
            self.featuremodel[:] = list(self.descriptors)
            self.setCurrentIndex(self.currentIndex)
            selmodel.selectionChanged.connect(self._on_selectedVariableChanged)
    self.editorstack.setEnabled((self.currentIndex >= 0))
