def keyPressEvent(self, qkeyevent): super(FilterBar.Filter, self).keyPressEvent(qkeyevent) if qkeyevent.key() == Qt.Key_Escape: self.on_remove(self)