1.对于主窗口,在构造函数中调用如下语句实现对话框大小调整
MainWindow::MainWindow(QWidget *parent) :
this->resize(QSize(1000,700));
2.对于弹出对话框,调用如下语句可实现:
QDialog dialog1(this);
dialog1.setWindowTitle("Hello World!");
dialog1.resize(QSize(300,100));
dialog1.exec();