示例#1
0
 def DrawCustomLine(self, painter, start, end):
     if start.x() == end.x() and start.y() == end.y():
         return
     VectorObj1 = Geometry.ClockWise(start - end, 100)
     VectorObj2 = Geometry.AntiClockWise(start - end, 100)
     if VectorObj1.x() == 0 and VectorObj1.y() == 0:
         return
     if VectorObj2.x() == 0 and VectorObj2.y() == 0:
         return
     #print 'vector_obj', VectorObj1, VectorObj2
     PointObj1 = Geometry.GetPointByVectorAndLegth(VectorObj1, 15)
     PointObj2 = Geometry.GetPointByVectorAndLegth(VectorObj2, 15)
     pathPaint = QPainterPath()
     pathPaint.moveTo(end)
     pathPaint.lineTo(PointObj1 + end)
     painter.drawPath(pathPaint)
     pathPaint.moveTo(end)
     pathPaint.lineTo(PointObj2 + end)
     painter.drawPath(pathPaint)
     #print PointObj1 + end, PointObj2 + end
     return