QgsRectangle rect(1, 2, 3, 4); // create a rectangle with coordinates (1, 2, 3, 4) rect.setXMinimum(0); // set the minimum X value to 0
QgsRectangle rect(1, 2, 3, 4); // create a rectangle with coordinates (1, 2, 3, 4) double maxX = rect.xMaximum(); // get the current maximum X value rect.setXMinimum(maxX); // set the minimum X value to the current maximum X valueIn this example, a QgsRectangle object is created with coordinates (1, 2, 3, 4). The xMaximum method is called to get the current maximum X value of the rectangle. The setXMinimum method is then called with the value of maxX, which sets the minimum X value of the rectangle to the current maximum X value. Package/library: QGIS C++ API.