setCentralWidget(ui->textEdit); //将txtEdit设置为中心组件,自动填充整个工作区
#include"mainwindow.h"#include<QApplication>#include<QDesktopWidget>intmain(intargc,char*argv[]){QApplicationa(argc,argv);MainWindow w;w.show();QDesktopWidget*desktop=QApplication::desktop();w.resize(desktop->width()*3/4,desktop->height()*3/4);w.move((desktop->width()-w.width())/2,(...