#include... QPointF p1(0, 0); QPointF p2(100, 100); QLineF line(p1, p2);
#include... QLineF line1(0, 0, 100, 100); QLineF line2(50, 0, 50, 100); if (line1.intersects(line2)) { // Do something }
#includeIn this example, we create a line and find its length using the length() method. Overall, QLineF is a useful class for 2D graphics manipulation in C++, and it is part of the Qt GUI library.... QLineF line(0, 0, 100, 100); qreal length = line.length();