...the rest. Next phase is to use recursion to make a Sierpinski Triangle.
// Inner triangle
pt1.setX(pt1.x() + side1.dx()/2);
pt1.setY(pt1.y() + side1.dy()/2);
pt2.setX(pt2.x() + side2.dx()/2);
pt2.setY(pt2.y() + side2.dy()/2);
pt3.setX(pt3.x() + side3.dx()/2);
pt3.setY(pt3.y() + side3.dy()/2);
side1 = QLineF(pt1, pt2);
side2 = QLineF(pt2, pt3);
side3 = QLineF(pt3, pt1);
myTriangle.clear();
myTriangle << side1 << side2 << side3;
mypainter.setPen(Qt::red);
mypainter.drawLines(myTriangle);