QPainter painter(this); painter.drawLine(QPointF(0,0), QPointF(100,100));
QPointF points[3] = {QPointF(0,0), QPointF(100,100), QPointF(200,0)}; QPainter painter(this); painter.drawPolyline(points, 3);This code creates an array of three points and draws a polyline that connects them. Package library: The QPainter class is part of the Qt library, which is a cross-platform application framework written in C++.