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)
评论列表
文章目录