利用布局管理器,设置查找页面
Dialog::Dialog(QWidget *parent) :
QDialog(parent, Qt::WindowCloseButtonHint),
ui(new Ui::Dialog)
{
ui->setupUi(this);
inite_model();
setLayout(&m_gridLayout); // 设置布局管理器
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::inite_model()
{
m_label.setText("Find What:");
m_pushButton.setText("Find Next");
m_checkBox.setText("Match Case");
m_forward.setText("ForWard");
m_backward.setText("BackWard");
m_forward.setChecked(true);
m_groupBox.setTitle("Direction");
m_closeButton.setText("cancel");
m_boxLayout.addWidget(&m_forward);
m_boxLayout.addWidget(&m_backward);
m_groupBox.setLayout(&m_boxLayout);
m_gridLayout.setSpacing(10);
m_gridLayout.addWidget(&m_label, 0, 0);
m_gridLayout.addWidget(&m_LineEdit, 0, 1);
m_gridLayout.addWidget(&m_pushButton, 0, 2);
m_gridLayout.addWidget(&m_checkBox, 1, 0);
m_gridLayout.addWidget(&m_groupBox, 1, 1);
m_gridLayout.addWidget(&m_closeButton, 1, 2);
}