QSize size(200, 100);
int width = size.width(); int height = size.height();
QSize scaled_size = size * 0.5;
QWidget *widget = new QWidget(); widget->resize(size);This creates a new QWidget object and sets its size to the dimensions contained in the "size" object. All of these examples use the QtGui library which is a part of the Qt package.