def test_focus_out_event(editor): panel = get_panel(editor) TextHelper(editor).goto_line(0) tc = TextHelper(editor).word_under_mouse_cursor() editor.setTextCursor(tc) panel.on_search() panel.focusOutEvent(QtGui.QFocusEvent(QtCore.QEvent.FocusOut)) assert not panel.hasFocus() # reopen panel for next tests panel.on_search() panel.setFocus()
def test_focus_out(editor): editor.save_on_focus_out = True editor.focusOutEvent(QtGui.QFocusEvent(QtCore.QEvent.FocusOut))