#includeQgsRectangle rect(0, 0, 180, 90); // create a rectangle from (0,0) to (180,90) rect.setYMinimum(-90); // set the southernmost point of the rectangle to -90 degrees
#includeLibrary: QgsRectangle is part of the QGIS library.QgsRectangle rect(0, 0, 180, 90); // create a rectangle from (0,0) to (180,90) const double ANIMATION_DURATION = 5.0; // animate over 5 seconds const double FRAME_RATE = 30.0; // update the position 30 times per second const double FRAME_INTERVAL = 1.0 / FRAME_RATE; // calculate the time between frames const double POSITION_DELTA = 15.0; // change position by 15 degrees each frame for (double t = 0.0; t < ANIMATION_DURATION; t += FRAME_INTERVAL) { // calculate the new position of the southernmost point double newY = -90 + POSITION_DELTA * t; rect.setYMinimum(newY); // wait until the next frame should be rendered QThread::msleep(FRAME_INTERVAL * 1000.0); }