QRect rect(10, 20, 50, 30); // x=10, y=20, width=50, height=30
int x = rect.x(); int y = rect.y(); int width = rect.width(); int height = rect.height();
QPoint point(30, 25); if (rect.contains(point)) { // point is inside the rectangle }
QRect otherRect(40, 10, 20, 40); if (rect.intersects(otherRect)) { // the two rectangles intersect }Overall, QRect is a useful and versatile class in the Qt library for GUI development.