示例#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)