-
Notifications
You must be signed in to change notification settings - Fork 0
/
paramdialog.cpp
41 lines (33 loc) · 1.15 KB
/
paramdialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "paramdialog.h"
#include <QLineEdit>
#include <QPushButton>
#include <QFormLayout>
#include <QHBoxLayout>
#include <QVBoxLayout>
ParamDialog::ParamDialog(QWidget *parent, Qt::WindowFlags f) :
QDialog(parent, f)
{
mNoiseEdit = new QLineEdit;
mPeekRadiusEdit = new QLineEdit;
QFormLayout *paramLayout = new QFormLayout;
paramLayout->addRow(tr(" 噪声:"), mNoiseEdit);
paramLayout->addRow(tr(" 峰域:"), mPeekRadiusEdit);
mConfirmButton = new QPushButton(tr("确定"));
mCancelButton = new QPushButton(tr("取消"));
QHBoxLayout *bottomLayout = new QHBoxLayout;
bottomLayout->addWidget(mConfirmButton);
bottomLayout->addWidget(mCancelButton);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(paramLayout);
mainLayout->addStretch();
mainLayout->addLayout(bottomLayout);
setLayout(mainLayout);
setMaximumSize(200, 150);
setMinimumHeight(150);
setWindowFlags(Qt::WindowCloseButtonHint);
connect(mConfirmButton, SIGNAL(clicked(bool)), this, SLOT(accept()));
connect(mCancelButton, SIGNAL(clicked(bool)), this, SLOT(reject()));
}
ParamDialog::~ParamDialog()
{
}