QgsRectangle rect(0, 0, 100, 100); rect.setXMaximum(150);
QgsRectangle rect; rect.setXMinimum(50); rect.setYMinimum(50); rect.setXMaximum(150); rect.setYMaximum(150);This code creates a new, empty rectangle and then sets the minimum x-coordinate to 50, the minimum y-coordinate to 50, the maximum x-coordinate to 150, and the maximum y-coordinate to 150. Package Library: QGIS C++ API.