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/nmWxWellLayerDlg.cpp

53 lines
1.6 KiB
C++

#include "nmWxWellLayerDlg.h"
#include <QVBoxLayout>
#include <QFormLayout>
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
//#include "nmGUIComponentBase.h"
Q_DECLARE_METATYPE(double *)
nmWxWellLayerDlg::nmWxWellLayerDlg(QVector<double> *vLayerHeights):
m_vLayerHeights(vLayerHeights) {
this->initLayerHeights();
this->initUI();
this->setWindowTitle(tr("layer setting"));
this->resize(540, 180);
}
void nmWxWellLayerDlg::initUI() {
QVBoxLayout* mainLayout = new QVBoxLayout;
this->setLayout(mainLayout);
// 设置内容区域
QVariant pValue = QVariant::fromValue(&((*m_vLayerHeights)[0]));
// nmGUIComponentBase * contentCom = new nmGUIComponentBase(tr("LayerHeight: "), pValue, NM_GUI_Component_Value_Type_Double, tr("m"));
// mainLayout->addWidget(contentCom);
// 底部按钮
QHBoxLayout* hLayout = new QHBoxLayout;
QPushButton* saveBT = new QPushButton(tr("Save"));
QPushButton* cancelBT = new QPushButton(tr("Cancel"));
connect(saveBT, SIGNAL(clicked()), this, SLOT(accept()));
connect(cancelBT, SIGNAL(clicked()), this, SLOT(reject()));
hLayout->addStretch();
hLayout->addWidget(saveBT);
hLayout->addWidget(cancelBT);
mainLayout->addLayout(hLayout);
}
void nmWxWellLayerDlg::initLayerHeights() {
if (m_vLayerHeights != nullptr) {
if (m_vLayerHeights->size() == 0) {
m_vLayerHeights->append(30.48);
}
}
}
void nmWxWellLayerDlg::on_layerHeightChanged(QString v) {
if (m_vLayerHeights != nullptr) {
m_vLayerHeights->clear();
m_vLayerHeights->append(v.toDouble());
}
}