#include "nmWxSelectWellsDlg.h" #include #include #include #include "nmData/nmDataLogFile.h" #include "ZxResolutionHelper.h" nmWxSelectWellsDlg::nmWxSelectWellsDlg(QWidget* parent): iDlgBase(parent) { m_mainLayout = NULL; this->setWindowTitle(tr("Select Wells")); this->initUI(); this->setMinimumSize(QSize(_resoSizeW(400), _resoSizeW(200))); } nmWxSelectWellsDlg::~nmWxSelectWellsDlg() { } void nmWxSelectWellsDlg::setWidget(QWidget *widget) { m_mainLayout->insertWidget(0, widget); } void nmWxSelectWellsDlg::initUI() { // 创建自定义视图 QLabel *customView = new QLabel("This is a custom view."); customView->setWordWrap(true); // 创建布局 m_mainLayout = new QVBoxLayout; this->setLayout(m_mainLayout); // 创建按钮框,并添加确定和取消按钮 QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); m_mainLayout->addWidget(buttonBox); // 连接按钮的信号到对话框的槽 connect(buttonBox, SIGNAL(accepted()), this, SLOT(on_accepted())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(on_rejected())); } void nmWxSelectWellsDlg::on_accepted() { this->accept(); } void nmWxSelectWellsDlg::on_rejected() { this->reject(); }