QRectF rect(0, 0, 50, 50); // create a rect with x=0, y=0, width=50, height=50 rect.setWidth(100); // set the width of the rect to 100
QRectF rect(0, 0, 50, 50); // create a rect with x=0, y=0, width=50, height=50 qreal width = rect.width(); // get the width of the rectThe QRectF class is a part of the Qt Core library (QtCore).