Do not close window if it has childwindows

This commit is contained in:
Sebastian Lohff 2013-12-07 21:09:17 +01:00
parent c75098f8ce
commit 1b93da5f11
2 changed files with 12 additions and 0 deletions

View File

@ -96,6 +96,12 @@ class SeopardyGame(QtGui.QWidget):
else: else:
return super(SeopardyGame, self).event(e) return super(SeopardyGame, self).event(e)
def closeEvent(self, event):
if not self._inOtherWindow:
event.accept()
else:
event.ignore()
def keyPressEvent(self, e): def keyPressEvent(self, e):
if e.key() == QtCore.Qt.Key_Escape: if e.key() == QtCore.Qt.Key_Escape:
self.close() self.close()

View File

@ -203,6 +203,12 @@ class EditAnswersWindow(QtGui.QDialog):
return qa return qa
def closeEvent(self, event):
if not self._in_window:
event.accept()
else:
event.ignore()
def _setupGui(self): def _setupGui(self):
self.layout = QtGui.QVBoxLayout() self.layout = QtGui.QVBoxLayout()