title: Creating an event filter
body: <p>I am trying to enable the delete key in my treeview. This is what I have so far:</p>
  
  <pre><code>class delkeyFilter(QObject):
      delkeyPressed = pyqtSignal()
  
      def eventFilter(self,  obj,  event):
          if event.type() == QEvent.KeyPress:
              if event.key() == Qt.Key_Delete:
                  self.delkeyPressed.emit()
                  print 'delkey pressed'
                  return True
          return False
  </code></pre>
  
  <p>I connect the <code>eventfilter</code> like this:</p>
  
  <pre><code>    filter = delkeyFilter(self.dataTreeView)
      self.dataTreeView.installEventFilter(filter)
  </code></pre>
  
  <p>Why do I need to pass <code>self.dataTreeview</code> when I create the filter? It doesn't work without it.</p>