QSize size(100, 50); int width = size.rwidth();
void resizeRectangle(QSize rectSize) { int width = rectSize.rwidth(); int height = rectSize.height(); // resize the rectangle } QSize size(100, 50); resizeRectangle(size);In this example, we define a function called 'resizeRectangle' that takes a QSize object as a parameter. We then use the rwidth property to retrieve the width value and assign it to an integer variable named 'width'. We also retrieve the height value using the height() property. Finally, we resize the rectangle using these values. Package library: Qt (https://doc.qt.io/qt-5/qsize.html#rwidth-prop)