'Event filter for search_text widget.
Emits signals when presing Enter and Shift+Enter.
This signals are used for search forward and backward.'

def eventFilter(self, widget, event):

    if (event.type() == QEvent.KeyPress):
        key = event.key()
        shift = (event.modifiers() & Qt.ShiftModifier)
        if (key == Qt.Key_Return):
            if shift:
                self.return_shift_pressed.emit()
            else:
                self.return_pressed.emit()
    return super(FindReplace, self).eventFilter(widget, event)
