qgraphtree.py 文件源码

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

项目:vivisect-py3 作者: bat-serjo 项目源码 文件源码
def drawLinesFrom(self, colnode):
        """
        Draw lines from our nodes to the specified one
        (used when we are on the left...)
        """
        scene = self.scene()
        colpos = colnode.scenePos()
        colrect = colnode.boundingRect()

        ecolor = self._v_vg.getMeta('edgecolor', '#000')
        pen = QtGui.QPen(QtGui.QColor(ecolor))

        for item in self.childItems():
            itpos = item.scenePos()
            itrect = item.boundingRect()

            x1 = itpos.x() + itrect.width()
            y1 = itpos.y() + (itrect.height() / 2)

            x2 = colpos.x()
            y2 = colpos.y() + (colrect.height() / 2)

            lineitem = scene.addLine(x1, y1, x2, y2, pen=pen)
            self._v_lines.append(lineitem)
            # lineitem.setParentItem(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号