Changeset 11758:b5cc48279d91 in orange


Ignore:
Timestamp:
11/11/13 18:44:21 (5 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Remove cluster selection when clicking outside the dendrogram tree.

(fixes #1343)

Location:
Orange/OrangeWidgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/OWClustering.py

    r10762 r11758  
    742742            self.emit(SIGNAL("dendrogramLayoutChanged()")) 
    743743        return ret 
    744      
     744 
     745    def mousePressEvent(self, event): 
     746        QGraphicsWidget.mousePressEvent(self, event) 
     747        if event.modifiers() == Qt.NoModifier and self.selected_items: 
     748            self.set_selected_clusters([]) 
     749 
    745750    if DEBUG: 
    746751        def paint(self, painter, options, widget=0): 
  • Orange/OrangeWidgets/Unsupervised/OWHierarchicalClustering.py

    r11357 r11758  
    895895                self.grid_widget.sizeHint(Qt.PreferredSize) 
    896896            ) 
     897 
     898    def mousePressEvent(self, event): 
     899        QGraphicsScene.mousePressEvent(self, event) 
     900        if event.modifiers() == Qt.NoModifier: 
     901            pos = self.widget.mapFromScene(event.pos()) 
     902            if not self.widget.contains(pos) and self.widget.selected_items: 
     903                self.widget.set_selected_clusters([]) 
    897904 
    898905    def _update_scene_rect(self): 
Note: See TracChangeset for help on using the changeset viewer.