照着书上的例子做的,结果却不对。
#include "dialog.h"
#include
dialog::dialog(QWidget *parent)
: QMainWindow(parent)
{
label1 = new QLabel(this);
label1->setText("label1");
lineEdit = new QLineEdit(this);
label2 = new QLabel(this);
label2->setText("label2");
button = new QPushButton(this);
button->setText("button");
QGridLayout *mainLayout = new QGridLayout(this);
mainLayout->addWidget(label1,0,0);
mainLayout->addWidget(lineEdit,0,1);
mainLayout->addWidget(label2,1,0);
mainLayout->addWidget(button,1,1);
}