From 2347f7563329bd6895766bb5910827d9cc0927ff Mon Sep 17 00:00:00 2001 From: donoban Date: Sat, 20 Oct 2018 21:54:25 +0200 Subject: [PATCH] Clear SearchBox with ESC key --- qubesmanager/qube_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index 3e936fe..23a8a42 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -71,6 +71,11 @@ class SearchBox(QtGui.QLineEdit): self.selectAll() self.focusing = False + def keyPressEvent(self, event): # pylint: disable=invalid-name + if event.key() == QtCore.Qt.Key_Escape: + self.clear() + super(SearchBox, self).keyPressEvent(event) + class VmRowInTable: # pylint: disable=too-few-public-methods