QRect rect(10, 20, 30, 40); rect.setRight(70);
QRect rect1(10, 20, 30, 40); QRect rect2(40, 30, 20, 10); if(rect1.intersects(rect2)){ // Rectangles intersect }This code creates two QRect objects, and checks if they intersect using the intersects function. If they do intersect, the code inside the if statement will execute. Package library: Qt.