glyphCellView.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:defconQt 作者: trufont 项目源码 文件源码
def _arrowKeyPressEvent(self, event):
        count = event.count()
        key = event.key()
        modifiers = event.modifiers()
        # TODO: it might be the case that self._lastSelectedCell cannot be None
        # when we arrive here whatsoever
        if self._lastSelectedCell is not None:
            if key == Qt.Key_Up:
                delta = -self._columnCount
            elif key == Qt.Key_Down:
                delta = self._columnCount
            elif key == Qt.Key_Left:
                delta = -1
            elif key == Qt.Key_Right:
                delta = 1
            newSel = self._lastSelectedCell + delta * count
            if newSel < 0 or newSel >= len(self._glyphs):
                return
            if modifiers & Qt.ShiftModifier:
                self._selection |= self._linearSelection(newSel)
            else:
                self._selection = {newSel}
            self._lastSelectedCell = newSel
            self.scrollToCell(newSel)
            self.selectionChanged.emit()
            self.update()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号