一、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构建速度慢

在“Make参数”的空白框处输入 -j4,代表使用4核。(上图使用snipaste 软件截图,比QQ方便多了)
博客主要提及两个Qt相关问题,一是Qt的mainwindow处无法布局,二是Qt构建速度慢。针对构建慢的问题,可在“Make参数”空白框输入 -j4,代表使用4核来提升速度。
14万+

被折叠的 条评论
为什么被折叠?



