roundedButtonSet.py 文件源码

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

项目:defconQt 作者: trufont 项目源码 文件源码
def mousePressEvent(self, event):
        if event.button() == Qt.LeftButton:
            for recordIndex, rect in self._optionsRects.items():
                if QRect(*rect).contains(event.pos()):
                    self._clickedIndex = recordIndex
                    self._oldSelection = self._selection
                    self._selection = {recordIndex}
                    if self._selectionMode > 1 and QApplication.keyboardModifiers(
                            ) & Qt.ShiftModifier:
                        shiftSelection = self._selection ^ self._oldSelection
                        if shiftSelection:
                            self._selection = shiftSelection
                    else:
                        self._selection |= self._oldSelection
                    break
            self.update()
        else:
            super().mousePressEvent(event)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号