mainwindow.h头文件中:
private:
Ui::MainWindow *ui;
QLabel *label;
QPushButton *button;
QVBoxLayout *layout;
mainwindow.cpp构造函数中:
label = new QLabel;
button = new QPushButton;
layout = new QVBoxLayout;
layout->addWidget(label);
layout->addWidget(button);
this->setLayout(layout);
为什么在窗口不显示?