26 #include <QDialogButtonBox>
27 #include <QGridLayout>
36 QString
const& labelName,
37 const QRegExp& regExp,
42 this->setWindowTitle(windowTitle);
43 QDialogButtonBox* buttonBox =
new QDialogButtonBox(
this);
44 buttonBox->setObjectName(QString::fromUtf8(
"buttonBox"));
45 buttonBox->setOrientation(Qt::Horizontal);
46 buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
47 edit =
new QLineEdit();
48 edit->setValidator(
new QRegExpValidator(regExp));
49 QGridLayout* layout =
new QGridLayout(
this);
50 this->setLayout(layout);
51 layout->addWidget(
new QLabel(labelName), 0, 0);
52 layout->addWidget(edit, 0, 1);
53 layout->addWidget(buttonBox, 1, 0, 1, 2);
54 connect(buttonBox, SIGNAL(accepted()),
this, SLOT(accept()));
55 connect(buttonBox, SIGNAL(rejected()),
this, SLOT(reject()));
56 resize(250, height());