// create a rectangle object QgsRectangle rect(0, 0, 100, 100); // set the maximum y-coordinate value of the rectangle to 200 rect.setYMaximum(200);
// create a rectangle object QgsRectangle rect(0, 0, 100, 100); // check the initial maximum y-coordinate value of the rectangle qDebug() << rect.yMaximum(); // output: 100 // set the maximum y-coordinate value of the rectangle to 150 rect.setYMaximum(150); // re-check the maximum y-coordinate value of the rectangle qDebug() << rect.yMaximum(); // output: 150This code creates a rectangle object with coordinates (0,0) as the lower-left corner and (100,100) as the upper-right corner. The initial maximum y-coordinate value of the rectangle is 100, as determined by the yMaximum function. The setYMaximum function is then used to set the maximum y-coordinate to 150. The yMaximum function is used again to check the new maximum y-coordinate value of the rectangle, which is now 150. Package Library: QGIS C++ API.