From d88c44f289eec946bc98f8a66ed89bdae2d30bb7 Mon Sep 17 00:00:00 2001 From: LoneGit Date: Sat, 27 Apr 2024 01:26:47 +0300 Subject: [PATCH] Adding processing for saving a project --- src/window.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/window.py b/src/window.py index ac8cf6d..e6e55d3 100644 --- a/src/window.py +++ b/src/window.py @@ -684,15 +684,19 @@ def change_layer_view( def eventFilter(self, obj, event): if event.type() == QEvent.KeyPress: - self.cancel_movement_event(event) + self.keyPressProcessing(event) return True return super().eventFilter(obj, event) def keyPressEvent(self, event): - if not self.cancel_movement_event(event): + if not self.keyPressProcessing(event): super().keyPressEvent(event) - def cancel_movement_event(self, event): + def keyPressProcessing(self, event): + if event.modifiers() == Qt.ControlModifier and event.key() == Qt.Key_S: + self.save_project_signal.emit() + return True + if self.move_button.isChecked(): if event.modifiers() == Qt.ControlModifier and event.key() == Qt.Key_Z: self.cancel_movement()