Do not close window if it has childwindows
This commit is contained in:
parent
c75098f8ce
commit
1b93da5f11
6
game.py
6
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()
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue