QRect rect(0, 0, 100, 50); QPoint bottomright = rect.bottomRight(); // bottomright will be (100, 50)
#includeIn this example, we create a QMainWindow object and use the geometry function to get the rectangle that represents its position and size on the screen. We then use the bottomRight function to get a QPoint object with the coordinates of the bottom right corner of the window. This example requires the QtWidgets package.#include int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow window; QRect rect = window.geometry(); QPoint bottomright = rect.bottomRight(); // bottomright will be the coordinates of the bottom right corner of the window return app.exec(); }