Refer the below code in your paint event to draw a line in Qt.
def paintEvent(self, event):
painter = Qt.QPainter()
painter.begin(self)
painter.pen().setWidth(int width)
painter.setPen(Qt.QColor(100,100,100))
painter.drawLine(x1,y1,x2,y2)
painter.end()
Qt.QFrame.paintEvent(self, event)