QPoint point(10, 20); point.setY(30); // Set y-coordinate to 30
QPoint point(10, 20); point.setY(point.y() + 5); // Increase y-coordinate by 5 point.setY(point.y() - 10); // Decrease y-coordinate by 10In both examples, the QPoint class is used along with the setY function to modify the y-coordinate of a point. The Qt library must be included in the project for this code to work.