You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
#include "nmDeleteConfirmationDlg.h"
|
|
|
|
#include <QVBoxLayout>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QHBoxLayout>
|
|
|
|
|
|
nmDeleteConfirmationDlg::nmDeleteConfirmationDlg() {
|
|
this->initUI();
|
|
this->resize(250,80);
|
|
}
|
|
|
|
void nmDeleteConfirmationDlg::initUI() {
|
|
// 设置对话框的窗口标题
|
|
this->setWindowTitle(tr("confirm"));
|
|
|
|
// 创建布局和控件
|
|
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
|
QLabel *messageLabel = new QLabel(tr("Do you confirm the deletion of the selected fault?"), this);
|
|
mainLayout->addWidget(messageLabel);
|
|
|
|
// 创建按钮
|
|
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
|
QPushButton *yesButton = new QPushButton(tr("Yes"), this);
|
|
QPushButton *noButton = new QPushButton(tr("No"), this);
|
|
|
|
// 连接按钮的点击信号
|
|
connect(yesButton, SIGNAL(clicked()), this, SLOT(accept()));
|
|
connect(noButton, SIGNAL(clicked()), this, SLOT(reject()));
|
|
|
|
buttonLayout->addStretch();
|
|
buttonLayout->addWidget(yesButton);
|
|
buttonLayout->addWidget(noButton);
|
|
mainLayout->addLayout(buttonLayout);
|
|
|
|
// 设置对话框的主布局
|
|
this->setLayout(mainLayout);
|
|
}
|