Commits

Martin Frlin committed f6ea199

Added selection deleting with delete key.

  • Participants
  • Parent commits 34029da

Comments (0)

Files changed (1)

File Orange/OrangeWidgets/Data/OWPaintData.py

 <priority>40</priority>
 <icon>icons/PaintData.svg</icon>
 """
+import orange
 
-import orange
+from PyQt4 import QtCore
 
 from OWWidget import *
 from OWGraph import *
     def installed(self):
         """ Called when the tool is installed on a graph.
         """
+        pass
         
     def eventFilter(self, obj, event):
         if event.type() == QEvent.MouseButtonPress:
         self.currentTool, self.currentOptionsWidget = tool, option = self.toolsStackCache[tool]
         self.optionsLayout.setCurrentWidget(option)
         self.currentTool.setGraph(self.graph)
+
         
     def onDomainChanged(self, *args):
         if self.variablesModel:
             
     def onDataChanged(self):
         self.dataChangedFlag = True
+
+    def keyPressEvent(self, event):
+        if event.key() == QtCore.Qt.Key_Delete and isinstance(self.currentTool, SelectTool):
+            self.currentTool.deleteSelected()
     
     def commitIf(self):
         if self.commitOnChange and self.dataChangedFlag: