diff --git a/game.py b/game.py index 023dc9f..e7d0f03 100644 --- a/game.py +++ b/game.py @@ -96,6 +96,12 @@ class SeopardyGame(QtGui.QWidget): else: return super(SeopardyGame, self).event(e) + def closeEvent(self, event): + if not self._inOtherWindow: + event.accept() + else: + event.ignore() + def keyPressEvent(self, e): if e.key() == QtCore.Qt.Key_Escape: self.close() diff --git a/windows.py b/windows.py index 657d7ca..6568855 100644 --- a/windows.py +++ b/windows.py @@ -203,6 +203,12 @@ class EditAnswersWindow(QtGui.QDialog): return qa + def closeEvent(self, event): + if not self._in_window: + event.accept() + else: + event.ignore() + def _setupGui(self): self.layout = QtGui.QVBoxLayout()