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.
nmWTAI-Platform/Src/nmNum/nmSubWxs/nmWxSelectResultWellsDlg.cpp

63 lines
1.6 KiB
C++

#include "nmWxSelectResultWellsDlg.h"
#include <QPushButton>
#include <QDebug>
#include <QVBoxLayout>
#include "nmData/nmDataLogFile.h"
#include "ZxResolutionHelper.h"
nmWxSelectResultWellsDlg::nmWxSelectResultWellsDlg(QWidget* parent)
: iDlgBase(parent),
m_mainLayout(NULL),
m_wellListWidget(NULL)
{
this->setWindowTitle(tr("View Well Data"));
this->initUI();
this->setMinimumSize(QSize(_resoSizeW(400), _resoSizeW(200)));
}
nmWxSelectResultWellsDlg::~nmWxSelectResultWellsDlg()
{
}
void nmWxSelectResultWellsDlg::setWidget(QWidget *widget)
{
m_wellListWidget = qobject_cast<nmWxSelectResultWellsWidget*>(widget);
if (widget) {
m_mainLayout->insertWidget(0, widget);
}
}
void nmWxSelectResultWellsDlg::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);
m_mainLayout->addWidget(buttonBox);
// 连接按钮的信号到对话框的槽
connect(buttonBox, SIGNAL(accepted()), this, SLOT(on_accepted()));
//connect(buttonBox, SIGNAL(rejected()), this, SLOT(on_rejected()));
}
void nmWxSelectResultWellsDlg::on_accepted()
{
if (m_wellListWidget) {
QString selectedWell = m_wellListWidget->getSelectedItem();
emit wellSelected(selectedWell); // 发射信号
}
//this->accept();
}
void nmWxSelectResultWellsDlg::on_rejected()
{
//this->reject();
}