一、qt的mianwindow处不能布局。
//我们在mainwindow中添加2个控件:pushButton和pushButton_2:
QWidget *centerWindow = new QWidget(this); //this is point to QMainWindow
setCentralWidget(centerWindow);
QHBoxLayout *layout1 = new QHBoxLayout;
layout1->addWidget(ui->pushButton);
layout1->addWidget(ui->pushButton_2);
centerWindow->setLayout(layout1);
二、Qt构建速度慢
![](https://img-blog.csdn.net/20180825204710193?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2x4bHNpbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
在“Make参数”的空白框处输入 -j4,代表使用4核。(上图使用snipaste 软件截图,比QQ方便多了)