UninstallDialog: Handle Escape key
Handle Escape key to go through the proper cancellation routine.
This commit is contained in:
parent
f9e8dbe528
commit
0ea8d2c0d2
|
@ -1,5 +1,5 @@
|
|||
from PyQt5.QtCore import Qt, pyqtSignal, QCoreApplication
|
||||
from PyQt5.QtGui import QCloseEvent
|
||||
from PyQt5.QtGui import QCloseEvent, QKeyEvent
|
||||
from PyQt5.QtWidgets import (
|
||||
QDialog,
|
||||
QLabel,
|
||||
|
@ -75,3 +75,8 @@ class UninstallDialog(QDialog):
|
|||
def __on_cancel(self):
|
||||
self.options.values = (None, None, None)
|
||||
self.close()
|
||||
|
||||
def keyPressEvent(self, e: QKeyEvent) -> None:
|
||||
if e.key() == Qt.Key_Escape:
|
||||
e.accept()
|
||||
self.__on_cancel()
|
||||
|
|
Loading…
Reference in a new issue