Clear searchbox pressing esc without need of selecting it

This commit is contained in:
donoban 2018-11-25 19:28:07 +01:00
parent 4deaedd1e0
commit b2bdae2c2d
No known key found for this signature in database
GPG Key ID: 141310D8E3ED08A5

View File

@ -70,11 +70,6 @@ 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
@ -479,6 +474,11 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QtGui.QMainWindow):
timer.start(1000 * 30) # 30s
self.check_updates()
def keyPressEvent(self, event): # pylint: disable=invalid-name
if event.key() == QtCore.Qt.Key_Escape:
self.searchbox.clear()
super(VmManagerWindow, self).keyPressEvent(event)
def clear_threads(self):
for thread in self.threads_list:
if thread.isFinished():