Changeset 10733:e9a87e4e4a12 in orange


Ignore:
Timestamp:
04/03/12 17:00:40 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Children:
10735:3ea3e3d7958c, 10742:c43d78667384
rebase_source:
3bbb088c25cfb49d9c09ca54051b235a0bbd0fcd
Message:

"Control - A" selects all widgets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/orngView.py

    r10731 r10733  
    171171    def unselectAllWidgets(self): 
    172172        for item in self.doc.widgets: 
    173             item.setSelected(0) 
     173            item.setSelected(False) 
     174             
     175    def selectAllWidgets(self): 
     176        for item in self.doc.widgets: 
     177            item.setSelected(True) 
    174178 
    175179    def getItemsAtPos(self, pos, itemType = None): 
     
    225229            rect = self.maxSelectionRect(QRectF(self.mouseDownPosition, self.mouseDownPosition)) 
    226230            self.widgetSelectionRect = QGraphicsRectItem(rect, None, self.scene()) 
    227             self.widgetSelectionRect.setPen(QPen(QBrush(QColor(51, 153, 255, 192)), 1, Qt.SolidLine, Qt.RoundCap)) 
     231            self.widgetSelectionRect.setPen(QPen(QBrush(QColor(51, 153, 255, 192)), 0.4, Qt.SolidLine, Qt.RoundCap)) 
    228232            self.widgetSelectionRect.setBrush(QBrush(QColor(168, 202, 236, 192))) 
    229233            self.widgetSelectionRect.setZValue(-100) 
     
    438442        sceneRect = minGeom.united(b_rect) 
    439443        return rect.intersected(sceneRect).adjusted(penWidth, penWidth, -penWidth, -penWidth) 
    440 #         
    441 #    def resizeEvent(self, event): 
    442 #        self.updateSceneRect() 
    443  
     444 
     445    def keyPressEvent(self, event): 
     446        if event == QKeySequence.SelectAll: 
     447            self.selectAllWidgets() 
     448        else: 
     449            return QGraphicsView.keyPressEvent(self, event) 
Note: See TracChangeset for help on using the changeset viewer.