glyphCellView.py 文件源码

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

项目:defconQt 作者: trufont 项目源码 文件源码
def mouseMoveEvent(self, event):
        if event.buttons() & (Qt.LeftButton | Qt.RightButton):
            index = self._findIndexForEvent(event, True)
            if index == self._lastSelectedCell:
                return
            if self.maybeExecuteDrag(event):
                return
            self.scrollToCell(index)
            if index >= len(self._glyphs):
                return

            modifiers = event.modifiers()
            if modifiers & Qt.ControlModifier:
                if index in self._selection and index in self._oldSelection:
                    self._selection.remove(index)
                elif index not in self._selection and \
                        index not in self._oldSelection:
                    self._selection.add(index)
            elif modifiers & Qt.ShiftModifier:
                self._selection = self._linearSelection(index)
            else:
                self._selection = {index}
            self._lastSelectedCell = index
            self.selectionChanged.emit()
            self.update()
        else:
            super(GlyphCellWidget, self).mouseMoveEvent(event)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号