feat(nmSubWxs): 优化编辑井对话框井信息布局

- 将时间变表皮开关及详情入口移至井信息分组末行
- 调整井信息为三列布局,井号、井名和井型控件仅占第二列
- 在底部增加与储层特性对话框一致的帮助按钮
- 补充帮助按钮中文翻译并更新翻译资源
feature/refactor-well-editor-20260821
lh 3 weeks ago
parent 3460b4680e
commit ed2b90de03

Binary file not shown.

@ -6567,6 +6567,7 @@ Average pressure in contour: %2 MPa</source>
<message><source>Multistage fractured horizontal well</source><translation></translation></message>
<message><source>Time-dependent skin</source><translation></translation></message>
<message><source>Edit time-dependent skin</source><translation></translation></message>
<message><source>Help</source><translation></translation></message>
<message><source>OK</source><translation></translation></message>
<message><source>Cancel</source><translation></translation></message>
<message><source>Well name cannot be empty.</source><translation></translation></message>

@ -88,6 +88,9 @@ private slots:
/** @brief 以当前工作副本打开旧时间变表皮编辑窗口。 */
void slotEditTimeDependentSkin();
/** @brief 打开系统帮助文档。 */
void slotHelp();
/** @brief 根据参数面板有效状态刷新确定按钮。 */
void slotPanelValidityChanged(bool bValid);
@ -98,10 +101,10 @@ private:
/** @brief 创建左侧参数区、右侧轨迹区和底部命令区。 */
void createUi();
/** @brief 创建固定显示的井号、井名和井型信息区。 */
/** @brief 创建固定显示的井号、井名、井型和时间变表皮信息区。 */
QWidget* createWellInformationWidget(QWidget* pParent);
/** @brief 创建时间变表皮入口、校验提示和确认按钮区。 */
/** @brief 创建帮助入口、校验提示和确认按钮区。 */
QWidget* createFooter();
/** @brief 从当前工作副本回填时间变表皮控件。 */
@ -132,6 +135,7 @@ private:
QComboBox* m_pWellTypeComboBox; ///< 井型选择器。
QCheckBox* m_pTimeDependentCheckBox; ///< 时间变表皮开关。
QToolButton* m_pTimeDependentButton; ///< 时间变表皮详情入口。
QToolButton* m_pFooterHelpButton; ///< 底部帮助命令。
QDialogButtonBox* m_pButtonBox; ///< 确定和取消按钮区。
QLabel* m_pStatusLabel; ///< 当前校验错误。
QSplitter* m_pMainSplitter; ///< 参数与轨迹分割器。

@ -47,6 +47,7 @@ nmWxWellEditor::nmWxWellEditor(const nmWellEditContext& oContext,
m_pWellTypeComboBox(nullptr),
m_pTimeDependentCheckBox(nullptr),
m_pTimeDependentButton(nullptr),
m_pFooterHelpButton(nullptr),
m_pButtonBox(nullptr),
m_pStatusLabel(nullptr),
m_pMainSplitter(nullptr),
@ -445,14 +446,23 @@ QWidget* nmWxWellEditor::createWellInformationWidget(QWidget* pParent)
pInformationLayout->setHorizontalSpacing(6);
pInformationLayout->setVerticalSpacing(6);
pInformationLayout->setColumnStretch(0, 0);
pInformationLayout->setColumnStretch(1, 1);
pInformationLayout->setColumnStretch(1, 8);
pInformationLayout->setColumnStretch(2, 5);
pInformationLayout->setColumnMinimumWidth(
1, nmParameterField::editorMinimumWidth());
pInformationLayout->setColumnMinimumWidth(
2, nmParameterField::unitMinimumWidth());
QLabel* pCodeLabel = new QLabel(tr("Well number"), pInformationGroup);
QLabel* pNameLabel = new QLabel(tr("Well name"), pInformationGroup);
QLabel* pTypeLabel = new QLabel(tr("Well type"), pInformationGroup);
QLabel* pTimeDependentLabel = new QLabel(
tr("Time-dependent skin"), pInformationGroup);
pCodeLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
pNameLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
pTypeLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
pTimeDependentLabel->setAlignment(
Qt::AlignRight | Qt::AlignVCenter);
m_pWellCodeLineEdit = new QLineEdit(pInformationGroup);
m_pWellNameLineEdit = new QLineEdit(pInformationGroup);
@ -475,12 +485,41 @@ QWidget* nmWxWellEditor::createWellInformationWidget(QWidget* pParent)
QSizePolicy::Expanding, QSizePolicy::Fixed);
}
// 时间变表皮属于井级配置,开关和详情入口共同放在值列。
QWidget* pTimeDependentEditor = new QWidget(pInformationGroup);
QHBoxLayout* pTimeDependentLayout = new QHBoxLayout(
pTimeDependentEditor);
pTimeDependentLayout->setContentsMargins(0, 0, 0, 0);
pTimeDependentLayout->setSpacing(4);
m_pTimeDependentCheckBox = new QCheckBox(pTimeDependentEditor);
m_pTimeDependentButton = new QToolButton(pTimeDependentEditor);
QString sIconDir = QCoreApplication::applicationDirPath()
.section('/', 0, -2) + "/Res/Icon/";
m_pTimeDependentButton->setIcon(
QIcon(sIconDir + "NmAnalDesign3.png"));
m_pTimeDependentButton->setIconSize(QSize(20, 20));
m_pTimeDependentButton->setFixedSize(26, 26);
m_pTimeDependentButton->setAutoRaise(true);
m_pTimeDependentButton->setToolTip(
tr("Edit time-dependent skin"));
m_pTimeDependentButton->setEnabled(false);
pTimeDependentLayout->addWidget(m_pTimeDependentCheckBox);
pTimeDependentLayout->addWidget(m_pTimeDependentButton);
pTimeDependentLayout->addStretch(1);
pInformationLayout->addWidget(pCodeLabel, 0, 0);
pInformationLayout->addWidget(m_pWellCodeLineEdit, 0, 1);
pInformationLayout->addWidget(pNameLabel, 1, 0);
pInformationLayout->addWidget(m_pWellNameLineEdit, 1, 1);
pInformationLayout->addWidget(pTypeLabel, 2, 0);
pInformationLayout->addWidget(m_pWellTypeComboBox, 2, 1);
pInformationLayout->addWidget(pTimeDependentLabel, 3, 0);
pInformationLayout->addWidget(pTimeDependentEditor, 3, 1);
connect(m_pTimeDependentCheckBox, SIGNAL(toggled(bool)),
this, SLOT(slotTimeDependentToggled(bool)));
connect(m_pTimeDependentButton, SIGNAL(clicked()),
this, SLOT(slotEditTimeDependentSkin()));
return pInformationGroup;
}
@ -491,20 +530,13 @@ QWidget* nmWxWellEditor::createFooter()
pFooterLayout->setContentsMargins(4, 5, 4, 5);
pFooterLayout->setSpacing(8);
// 左侧保留时间变表皮开关和详情入口。
m_pTimeDependentCheckBox = new QCheckBox(
tr("Time-dependent skin"), pFooter);
m_pTimeDependentButton = new QToolButton(pFooter);
QString sIconDir = QCoreApplication::applicationDirPath()
.section('/', 0, -2) + "/Res/Icon/";
m_pTimeDependentButton->setIcon(
QIcon(sIconDir + "NmAnalDesign3.png"));
m_pTimeDependentButton->setIconSize(QSize(20, 20));
m_pTimeDependentButton->setFixedSize(26, 26);
m_pTimeDependentButton->setAutoRaise(true);
m_pTimeDependentButton->setToolTip(
tr("Edit time-dependent skin"));
m_pTimeDependentButton->setEnabled(false);
// 左侧帮助命令与储层特性对话框保持相同样式和行为。
m_pFooterHelpButton = new QToolButton(pFooter);
m_pFooterHelpButton->setText(tr("Help"));
m_pFooterHelpButton->setIcon(zxLoadIcon("Help"));
m_pFooterHelpButton->setToolButtonStyle(
Qt::ToolButtonTextBesideIcon);
m_pFooterHelpButton->setAutoRaise(true);
// 中间状态区使用主题调色板,仅将错误文字标红。
m_pStatusLabel = new QLabel(pFooter);
@ -533,20 +565,22 @@ QWidget* nmWxWellEditor::createFooter()
pCancelButton->setText(tr("Cancel"));
}
pFooterLayout->addWidget(m_pTimeDependentCheckBox);
pFooterLayout->addWidget(m_pTimeDependentButton);
pFooterLayout->addWidget(m_pFooterHelpButton);
pFooterLayout->addWidget(m_pStatusLabel, 1);
pFooterLayout->addWidget(m_pButtonBox);
connect(m_pTimeDependentCheckBox, SIGNAL(toggled(bool)),
this, SLOT(slotTimeDependentToggled(bool)));
connect(m_pTimeDependentButton, SIGNAL(clicked()),
this, SLOT(slotEditTimeDependentSkin()));
connect(m_pFooterHelpButton, SIGNAL(clicked()),
this, SLOT(slotHelp()));
connect(m_pButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(m_pButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
return pFooter;
}
void nmWxWellEditor::slotHelp()
{
ZxBaseUtil::startHelp();
}
void nmWxWellEditor::createController()
{
// 控制器持有当前工作副本指针,井型切换后必须销毁并重新绑定。

Loading…
Cancel
Save