'Selection updated by `heatmap_widget due to `event` (mouse drag).'

def selection_update(self, heatmap_widget, event):

    pos = heatmap_widget.mapFromScene(event.scenePos())
    (row, _) = heatmap_widget.cell_at(pos)
    if (row < 0):
        return
    (start, _) = self._heatmap_ranges[heatmap_widget]
    row = (start + row)
    if (event.modifiers() & Qt.ControlModifier):
        self.selection_ranges = self.remove_range(self.selection_ranges_temp, self._start_row, row, append=True)
    elif (event.modifiers() & Qt.AltModifier):
        self.selection_ranges = self.remove_range(self.selection_ranges, self._start_row, row, append=False)
    elif self.selection_ranges:
        self.selection_ranges[(-1)] = (self._start_row, row)
    else:
        self.selection_ranges = [(row, row)]
    self.select_rows(self.combined_ranges(self.selection_ranges))
