title: How can I rotate or move QGraphicsLineItem from one side?
body: <p>This line is supposed to connect nodes (which are ellipses) and can add multiple children nodes too, so I'm trying to figure how to rotate or re-size the line so it can point to different directions because it's drawn in only one direction by default.</p>
  <pre><code>   class Line (QGraphicsLineItem):
      
          source=QPoint()
          destination=QPoint()
          name=&quot;&quot;
          currentx=0
          isPressed=False
          def __init__(self,source,destination,name, parent=None):
              super().__init__(parent)
              self.name=name
              print(self.name)
              self.source = source
              self.destination = destination
              self.setAcceptHoverEvents(True)
              self.setAcceptHoverEvents(True)
              self.setFlag(self.ItemIsMovable)
              self.setFlag(self.ItemSendsGeometryChanges)
              self.setFlag(self.ItemIsMovable)
              self.setFlag(self.ItemSendsGeometryChanges)
              self.setCursor(QtCore.Qt.SizeAllCursor) 
              #where I create the Line
              self.setLine(self.source.x(),self.source.y(),
              self.destination.x()+40,self.destination.y()+40)
              #just adding text
              self.textItem = QGraphicsSimpleTextItem(self.name, self)
              rect = self.textItem.boundingRect()
              rect.moveCenter(self.boundingRect().center())
              self.textItem.setPos(rect.topLeft())
             
      
              
          #not sure what to do with this method
          def mousePressEvent(self, event):    
              self.currentx=event.scenePos().x()
              self.currenty=event.scenePos().y()
              isPressed=True
        
      
          def mouseReleaseEvent(self, event):
              releaseX=event.scenePos().x()
              releaseY=event.scenePos().y()
              diffX=releaseX-self.currentx
              diffY=releaseY-self.currenty
      
              old_source_x=self.source.x()
              old_source_y=self.source.y()
              old_destination_x=self.destination.x()
              old_destination_y=self.destination.y()
              new_source_x=old_source_x+diffX
              new_source_y=old_source_y+diffY
              self.source=QPoint(int(new_source_x),int(new_source_y))
              new_destination_x=old_destination_x+diffX
              new_destination_y=old_destination_y+diffY
              self.destination=QPoint(int(new_destination_x),int(new_destination_y))
              self.setLine(new_source_x,new_source_y, new_destination_x, new_destination_y)
  </code></pre>