(self, heatmap_widget, event)
Selection updated by `heatmap_widget due to `event` (mouse drag).
Selection updated by `heatmap_widget due to `event` (mouse drag).
Selection updated by heatmap_widget due to event ( mouse drag ) .
def selection_update(self, heatmap_widget, event):
        """ Selection updated by `heatmap_widget due to `event` (mouse drag).
        """
        pos = heatmap_widget.mapFromScene(event.scenePos())
        row, _ = heatmap_widget.heatmapCellAt(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)
        else:
            if 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))
def selection_update ( self , heatmap_widget , event ) : pos = heatmap_widget . mapFromScene ( event . scenePos ( ) ) row , _ = heatmap_widget . heatmapCellAt ( 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 ) else : if 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 ) )