def keyPressEvent(self, event):
"""
Prevent the user from closing the dialog using the ESC key.
"""
if event.key() == Qt.Key_Escape:
event.ignore()
else:
QDialog.keyPressEvent(self, event)