예제 #1
0
파일: scene.py 프로젝트: KDE/kajongg
 def focusInEvent(self, event):
     """
     Work around a qt bug. See U{https://bugreports.qt-project.org/browse/QTBUG-32890}.
     This can be reproduced as follows:
      - ./kajongg.py --game=2/E2 --demo --ruleset=BMJA
            such that the human player is the first one to discard a tile.
      - wait until the main screen has been built
      - click with the mouse into the middle of that window
      - press left arrow key
      - this will violate the assertion in UITile.keyPressEvent.
     """
     prev = self.focusItem()
     QGraphicsScene.focusInEvent(self, event)
     if prev and bool(prev.flags() & QGraphicsItem.ItemIsFocusable) and prev != self.focusItem():
         self.setFocusItem(prev)
예제 #2
0
 def focusInEvent(self, event):
     """
     Work around a qt bug. See U{https://bugreports.qt-project.org/browse/QTBUG-32890}.
     This can be reproduced as follows:
      - ./kajongg.py --game=2/E2 --demo --ruleset=BMJA
            such that the human player is the first one to discard a tile.
      - wait until the main screen has been built
      - click with the mouse into the middle of that window
      - press left arrow key
      - this will violate the assertion in UITile.keyPressEvent.
     """
     prev = self.focusItem()
     QGraphicsScene.focusInEvent(self, event)
     if prev and bool(prev.flags() & QGraphicsItem.ItemIsFocusable
                      ) and prev != self.focusItem():
         self.setFocusItem(prev)
예제 #3
0
 def __init__(self):
     QGraphicsScene.__init__(self)
     self.focusRect = FocusRect()
     self.addItem(self.focusRect)
예제 #4
0
파일: scene.py 프로젝트: KDE/kajongg
 def __init__(self):
     QGraphicsScene.__init__(self)
     self.focusRect = FocusRect()
     self.addItem(self.focusRect)