QSize size(100, 50); int width = size.width(); // returns 100
QSize size(100, 50); size.setWidth(200); // size now has width 200 and height 50In this example, we create a new QSize object with width 100 and height 50. We then call the setWidth method to change the value of the width to 200. The QSize class is part of the Qt Core library.