// Create a rectangle and get its top-right point QRectF rect(0, 0, 100, 100); QPointF topRight = rect.topRight(); // Use the top-right point to position an item QLabel* label = new QLabel("Corner Widget"); label->move(topRight.x() - label->width(), topRight.y());In the above example, we create a rectangle with an origin at (0, 0) and a width and height of 100. We then use the topRight() function to get the top-right point of the rectangle, and use this point to position a QLabel widget in the corner. The QRectF class is part of the Qt library, so the code examples would require the Qt library to be included in the project.