code: def rebuild(self):
          
          # create the path
          path = self.rebuildPath()
          self._polygons = self.rebuildPolygons(path)
  
          if self._textItem:
              point = path.pointAtPercent(0.5)
              metrics = QFontMetrics(self._textItem.font())
  
              point.setY(point.y() - metrics.height() / 2.0)
  
              self._textItem.setPos(point)
  
          # create the path for the item
          for poly in self._polygons:
              path.addPolygon(poly)
  
          # unmark as dirty
          self.setDirty(False)
  
          return path
docs: Rebuilds the path for this connection based on the given connection \
          style parameters that have been set.
          
          :return     <QPainterPath>