From b88c998baea44ca78270556d779110204cdda7ed Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Thu, 21 Nov 2013 15:24:42 +0100 Subject: [PATCH] Code cleanup --- game.py | 5 ----- windows.py | 13 +++++-------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/game.py b/game.py index d4449b2..0e467f2 100644 --- a/game.py +++ b/game.py @@ -64,11 +64,6 @@ class SeopardyGame(QtGui.QWidget): self.board.itemAtPosition(number, secno-1).widget().setFocus() - def event(self, e): - if e.type() == QtCore.QEvent.KeyPress and e.key() == QtCore.Qt.Key_Left: - print("Key!!!", e.key()) - return super(SeopardyGame, self).event(e) - def keyPressEvent(self, e): if e.key() == QtCore.Qt.Key_Escape: self.close() diff --git a/windows.py b/windows.py index bcc80d5..6465262 100644 --- a/windows.py +++ b/windows.py @@ -204,12 +204,12 @@ class EditAnswersWindow(QtGui.QDialog): self.updateGeometry() # reset focus - print("setting focus to", min(currFocus, self.answerlayout.count()), self.answerlayout.itemAt(min(currFocus, self.answerlayout.count())).widget().text(), self.answerlayout.itemAt(min(currFocus, self.answerlayout.count())).widget().hasFocus()) + #print("setting focus to", min(currFocus, self.answerlayout.count()), self.answerlayout.itemAt(min(currFocus, self.answerlayout.count())).widget().text(), self.answerlayout.itemAt(min(currFocus, self.answerlayout.count())).widget().hasFocus()) self.answerlayout.itemAt(min(currFocus, self.answerlayout.count())).widget().setFocus(QtCore.Qt.FocusReason.NoFocusReason) - print("setting focus to", min(currFocus, self.answerlayout.count()), self.answerlayout.itemAt(min(currFocus, self.answerlayout.count())).widget().text(), self.answerlayout.itemAt(min(currFocus, self.answerlayout.count())).widget().hasFocus()) - print(self.focusWidget()) - if self.focusWidget(): - print("widget", self.focusWidget().text()) + #print("setting focus to", min(currFocus, self.answerlayout.count()), self.answerlayout.itemAt(min(currFocus, self.answerlayout.count())).widget().text(), self.answerlayout.itemAt(min(currFocus, self.answerlayout.count())).widget().hasFocus()) + #print(self.focusWidget()) + #if self.focusWidget(): + # print("widget", self.focusWidget().text()) def _makeNobodyConsistent(self): if len(self._tries) > 0: @@ -224,7 +224,6 @@ class EditAnswersWindow(QtGui.QDialog): return None def _resetAllButtons(self): - print("resetting all buttons") f = self.answerlayout.takeAt(0) while f is not None: f.widget().deleteLater() @@ -232,11 +231,9 @@ class EditAnswersWindow(QtGui.QDialog): # add buttons for player, correct in self._tries: - print("building button for", player) self._addAnswerButton(player, correct) # add the nobody button - print("adding the nobody button") self._addAnswerButton(Player("nobody", QtGui.QColor(128, 128, 128)), self._nobody) def _addAnswerButton(self, player, correct=False):