QWidget* widget = new QWidget(); QRect frameGeometry = widget->frameGeometry();
QWidget* widget = new QWidget(); QRect frameGeometry = widget->frameGeometry(); frameGeometry.setWidth(frameGeometry.width() + 10); frameGeometry.setHeight(frameGeometry.height() + 10); widget->setGeometry(frameGeometry);This code creates a new QWidget and then increases its width and height by 10 pixels. The widget's geometry is updated using the setGeometry function, which takes a QRect argument. Package library: Qt Core (QtGui module)