|
|
|
|
@ -1,14 +1,17 @@
|
|
|
|
|
#include "nmWxIncludeOtherWells.h"
|
|
|
|
|
#include "nmDataAnalyzeManager.h"
|
|
|
|
|
#include "nmDataWellBase.h"
|
|
|
|
|
#include "ZxBaseUtil.h"
|
|
|
|
|
|
|
|
|
|
#include <QAbstractItemView>
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QDesktopWidget>
|
|
|
|
|
#include <QDialogButtonBox>
|
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
#include <QStyle>
|
|
|
|
|
#include <QToolButton>
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
|
@ -244,6 +247,7 @@ nmWxIncludeOtherWells::nmWxIncludeOtherWells(
|
|
|
|
|
nmDataAnalyzeManager* pDataManager,
|
|
|
|
|
QWidget* pParent)
|
|
|
|
|
: iDlgBase(pParent), m_pDataManager(pDataManager), m_pTableWidget(nullptr),
|
|
|
|
|
m_pFooterHelpButton(nullptr), m_pButtonBox(nullptr),
|
|
|
|
|
m_pOkButton(nullptr), m_pCancelButton(nullptr),
|
|
|
|
|
m_pButtonLayout(nullptr), m_pMainLayout(nullptr)
|
|
|
|
|
{
|
|
|
|
|
@ -263,6 +267,7 @@ void nmWxIncludeOtherWells::initUI()
|
|
|
|
|
this->setupConnections();
|
|
|
|
|
|
|
|
|
|
this->setWindowTitle(tr("Include Other Wells"));
|
|
|
|
|
this->setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
|
|
|
// 初始尺寸跟随列宽和井数量,手动缩小时仍由滚动条保护表头及下拉内容。
|
|
|
|
|
this->setMinimumSize(720, 240);
|
|
|
|
|
this->adjustDialogSizeToTable();
|
|
|
|
|
@ -486,8 +491,9 @@ void nmWxIncludeOtherWells::adjustDialogSizeToTable()
|
|
|
|
|
int nBottom = 0;
|
|
|
|
|
m_pMainLayout->getContentsMargins(&nLeft, &nTop, &nRight, &nBottom);
|
|
|
|
|
const int nLayoutWidth = nLeft + nRight;
|
|
|
|
|
const int nButtonHeight = qMax(m_pOkButton->sizeHint().height(),
|
|
|
|
|
m_pCancelButton->sizeHint().height());
|
|
|
|
|
const int nButtonHeight = qMax(m_pFooterHelpButton->sizeHint().height(),
|
|
|
|
|
qMax(m_pOkButton->sizeHint().height(),
|
|
|
|
|
m_pCancelButton->sizeHint().height()));
|
|
|
|
|
const int nLayoutHeight = nTop + nBottom + nButtonHeight +
|
|
|
|
|
m_pMainLayout->spacing();
|
|
|
|
|
|
|
|
|
|
@ -845,16 +851,33 @@ QVector<WellDataRow> nmWxIncludeOtherWells::getWellData() const
|
|
|
|
|
|
|
|
|
|
void nmWxIncludeOtherWells::setupButtons()
|
|
|
|
|
{
|
|
|
|
|
m_pOkButton = new QPushButton(tr("OK"), this);
|
|
|
|
|
m_pCancelButton = new QPushButton(tr("Cancel"), this);
|
|
|
|
|
m_pFooterHelpButton = new QToolButton(this);
|
|
|
|
|
m_pFooterHelpButton->setText(tr("Help"));
|
|
|
|
|
m_pFooterHelpButton->setIcon(zxLoadIcon("Help"));
|
|
|
|
|
m_pFooterHelpButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
|
|
|
|
m_pFooterHelpButton->setAutoRaise(true);
|
|
|
|
|
|
|
|
|
|
m_pButtonBox = new QDialogButtonBox(
|
|
|
|
|
QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
|
|
|
|
|
Qt::Horizontal, this);
|
|
|
|
|
m_pOkButton = m_pButtonBox->button(QDialogButtonBox::Ok);
|
|
|
|
|
m_pCancelButton = m_pButtonBox->button(QDialogButtonBox::Cancel);
|
|
|
|
|
if(m_pOkButton != nullptr) {
|
|
|
|
|
m_pOkButton->setIcon(zxLoadIcon("OK"));
|
|
|
|
|
m_pOkButton->setText(tr("OK"));
|
|
|
|
|
}
|
|
|
|
|
if(m_pCancelButton != nullptr) {
|
|
|
|
|
m_pCancelButton->setIcon(zxLoadIcon("Cancel"));
|
|
|
|
|
m_pCancelButton->setText(tr("Cancel"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxIncludeOtherWells::setupLayouts()
|
|
|
|
|
{
|
|
|
|
|
m_pButtonLayout = new QHBoxLayout();
|
|
|
|
|
m_pButtonLayout->addWidget(m_pFooterHelpButton);
|
|
|
|
|
m_pButtonLayout->addStretch();
|
|
|
|
|
m_pButtonLayout->addWidget(m_pOkButton);
|
|
|
|
|
m_pButtonLayout->addWidget(m_pCancelButton);
|
|
|
|
|
m_pButtonLayout->addWidget(m_pButtonBox);
|
|
|
|
|
|
|
|
|
|
m_pMainLayout = new QVBoxLayout(this);
|
|
|
|
|
m_pMainLayout->addWidget(m_pTableWidget, 1);
|
|
|
|
|
@ -864,6 +887,12 @@ void nmWxIncludeOtherWells::setupLayouts()
|
|
|
|
|
|
|
|
|
|
void nmWxIncludeOtherWells::setupConnections()
|
|
|
|
|
{
|
|
|
|
|
connect(m_pOkButton, SIGNAL(clicked()), this, SLOT(accept()));
|
|
|
|
|
connect(m_pCancelButton, SIGNAL(clicked()), this, SLOT(reject()));
|
|
|
|
|
connect(m_pFooterHelpButton, SIGNAL(clicked()), this, SLOT(slotHelp()));
|
|
|
|
|
connect(m_pButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
|
|
|
|
connect(m_pButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxIncludeOtherWells::slotHelp()
|
|
|
|
|
{
|
|
|
|
|
ZxBaseUtil::startHelp();
|
|
|
|
|
}
|
|
|
|
|
|