QPointF point(3.0, 4.0); // creating a QPointF object point.setX(5.5); // setting the x-coordinate to 5.5
QPointF point(3.0, 4.0); // creating a QPointF object double new_x = 6.5; point.setX(new_x); // setting the x-coordinate to new_x
QPointF point(3.0, 4.0); // creating a QPointF object point.setX(point.x() + 2); // adding 2 to the current x-coordinateThese examples use the Qt package library.