diff --git a/Bin/Config/Lang/cn/nmNum_cn.qm b/Bin/Config/Lang/cn/nmNum_cn.qm index 3092a7f..fb8dbc0 100644 Binary files a/Bin/Config/Lang/cn/nmNum_cn.qm and b/Bin/Config/Lang/cn/nmNum_cn.qm differ diff --git a/Bin/Config/Lang/cn/nmNum_cn.ts b/Bin/Config/Lang/cn/nmNum_cn.ts index 138c4fa..4b2d7a6 100644 --- a/Bin/Config/Lang/cn/nmNum_cn.ts +++ b/Bin/Config/Lang/cn/nmNum_cn.ts @@ -6790,18 +6790,8 @@ Average pressure in contour: %2 MPa nmReservoirParameterPage - Reservoir parameters储层参数 - Well parameters井参数 - Fault parameters断层参数 - Fracture parameters裂缝参数 - Composite region parameters复合区参数 - Region mark parameters区域标记参数 - Select well:选择井: - Select fault:选择断层: - Select fracture:选择裂缝: - Select composite region:选择复合区: - Select region mark:选择区域标记: - Select object:选择对象: + Object display对象显示 + Display:显示: No editable objects in this category.此分类中没有可编辑对象。 diff --git a/Include/nmNum/nmSubWxs/nmReservoirParameterPage.h b/Include/nmNum/nmSubWxs/nmReservoirParameterPage.h index 10b80f8..db3cc1e 100644 --- a/Include/nmNum/nmSubWxs/nmReservoirParameterPage.h +++ b/Include/nmNum/nmSubWxs/nmReservoirParameterPage.h @@ -12,6 +12,7 @@ class nmReservoirParameterField; class nmReservoirPropertiesSession; class QComboBox; class QGridLayout; +class QGroupBox; class QLabel; class QVBoxLayout; @@ -76,15 +77,9 @@ private slots: void slotEnumIndexChanged(int nIndex); private: - /** @brief 创建页标题、对象选择器和单层分组区域。 */ + /** @brief 创建对象显示控制区和单层参数分组区域。 */ void createUi(); - /** @brief 根据当前分类返回标题。 */ - QString categoryTitle() const; - - /** @brief 根据当前分类返回对象选择标签。 */ - QString objectSelectorLabel() const; - /** @brief 构建指定对象的全部分组和字段。 */ bool buildObject(int nObjectIndex, QString& sError); @@ -115,8 +110,8 @@ private: bool m_bUpdatingObject; ///< 阻止对象下拉框回滚重入。 bool m_bBuildingFields; ///< 阻止加载数据时触发业务信号。 - QLabel* m_pTitleLabel; ///< 页面标题。 - QLabel* m_pObjectLabel; ///< 对象选择标签。 + QGroupBox* m_pObjectDisplayGroup; ///< 对象显示控制分组。 + QLabel* m_pObjectLabel; ///< 对象显示标签。 QComboBox* m_pObjectComboBox; ///< 多对象选择下拉框。 QWidget* m_pGroupsWidget; ///< 无边框的分组布局载体。 QGridLayout* m_pGroupsLayout; ///< 两列分组布局。 diff --git a/Src/nmNum/nmSubWxs/nmReservoirParameterPage.cpp b/Src/nmNum/nmSubWxs/nmReservoirParameterPage.cpp index 51565fd..3a0f630 100644 --- a/Src/nmNum/nmSubWxs/nmReservoirParameterPage.cpp +++ b/Src/nmNum/nmSubWxs/nmReservoirParameterPage.cpp @@ -23,7 +23,7 @@ nmReservoirParameterPage::nmReservoirParameterPage( m_nCurrentObjectIndex(-1), m_bUpdatingObject(false), m_bBuildingFields(false), - m_pTitleLabel(nullptr), + m_pObjectDisplayGroup(nullptr), m_pObjectLabel(nullptr), m_pObjectComboBox(nullptr), m_pGroupsWidget(nullptr), @@ -45,35 +45,31 @@ nmReservoirParameterPage::~nmReservoirParameterPage() void nmReservoirParameterPage::createUi() { - // 第一步:创建原型中的单层内容头,储层页自动隐藏对象选择器。 + // 第一步:创建单行对象显示控制区,储层页自动隐藏该分组。 m_pMainLayout = new QVBoxLayout(this); m_pMainLayout->setContentsMargins(8, 6, 8, 8); m_pMainLayout->setSpacing(8); - QWidget* pHeaderWidget = new QWidget(this); - QHBoxLayout* pHeaderLayout = new QHBoxLayout(pHeaderWidget); - pHeaderLayout->setContentsMargins(8, 4, 8, 4); - pHeaderLayout->setSpacing(9); + m_pObjectDisplayGroup = new QGroupBox(tr("Object display"), this); + m_pObjectDisplayGroup->setSizePolicy( + QSizePolicy::Expanding, QSizePolicy::Fixed); + QHBoxLayout* pObjectLayout = new QHBoxLayout(m_pObjectDisplayGroup); + pObjectLayout->setContentsMargins(8, 15, 8, 8); + pObjectLayout->setSpacing(9); - m_pTitleLabel = new QLabel(categoryTitle(), pHeaderWidget); - pHeaderLayout->addWidget(m_pTitleLabel, 1); - - m_pObjectLabel = new QLabel(objectSelectorLabel(), pHeaderWidget); - m_pObjectComboBox = new QComboBox(pHeaderWidget); + m_pObjectLabel = new QLabel(tr("Display:"), m_pObjectDisplayGroup); + m_pObjectLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); + m_pObjectComboBox = new QComboBox(m_pObjectDisplayGroup); m_pObjectComboBox->setMinimumWidth(260); + m_pObjectComboBox->setMaximumWidth(420); m_pObjectComboBox->setMinimumHeight(27); - pHeaderLayout->addWidget(m_pObjectLabel); - pHeaderLayout->addWidget(m_pObjectComboBox); - // 储层页只有一个固定对象,顶部分类按钮已经说明当前页面, - // 不再重复显示无操作价值的页标题;其他页面保留对象选择区。 - if (m_eCategory == NM_RESERVOIR_PAGE_RESERVOIR) - { - pHeaderWidget->hide(); - } - else - { - m_pMainLayout->addWidget(pHeaderWidget); - } + pObjectLayout->addStretch(1); + pObjectLayout->addWidget(m_pObjectLabel); + pObjectLayout->addWidget(m_pObjectComboBox); + pObjectLayout->addStretch(1); + m_pMainLayout->addWidget(m_pObjectDisplayGroup); + m_pObjectDisplayGroup->setVisible( + m_eCategory != NM_RESERVOIR_PAGE_RESERVOIR); // 第二步:分组载体没有边框,仅用于实现原型中的两列网格。 m_pGroupsWidget = new QWidget(this); @@ -90,46 +86,6 @@ void nmReservoirParameterPage::createUi() this, SLOT(slotObjectChanged(int))); } -QString nmReservoirParameterPage::categoryTitle() const -{ - switch (m_eCategory) - { - case NM_RESERVOIR_PAGE_RESERVOIR: - return tr("Reservoir parameters"); - case NM_RESERVOIR_PAGE_WELL: - return tr("Well parameters"); - case NM_RESERVOIR_PAGE_FAULT: - return tr("Fault parameters"); - case NM_RESERVOIR_PAGE_FRACTURE: - return tr("Fracture parameters"); - case NM_RESERVOIR_PAGE_COMPOSITE_REGION: - return tr("Composite region parameters"); - case NM_RESERVOIR_PAGE_REGION_MARK: - return tr("Region mark parameters"); - default: - return QString(); - } -} - -QString nmReservoirParameterPage::objectSelectorLabel() const -{ - switch (m_eCategory) - { - case NM_RESERVOIR_PAGE_WELL: - return tr("Select well:"); - case NM_RESERVOIR_PAGE_FAULT: - return tr("Select fault:"); - case NM_RESERVOIR_PAGE_FRACTURE: - return tr("Select fracture:"); - case NM_RESERVOIR_PAGE_COMPOSITE_REGION: - return tr("Select composite region:"); - case NM_RESERVOIR_PAGE_REGION_MARK: - return tr("Select region mark:"); - default: - return tr("Select object:"); - } -} - bool nmReservoirParameterPage::reloadObjects(QString& sError) { // 第一步:重新取得会话对象描述,并把稳定对象code放入UserRole。 @@ -148,8 +104,7 @@ bool nmReservoirParameterPage::reloadObjects(QString& sError) m_bUpdatingObject = false; bool bShowSelector = m_eCategory != NM_RESERVOIR_PAGE_RESERVOIR; - m_pObjectLabel->setVisible(bShowSelector); - m_pObjectComboBox->setVisible(bShowSelector); + m_pObjectDisplayGroup->setVisible(bShowSelector); // 第二步:构建首个对象;空分类显示无额外面板的空状态。 return buildObject(m_listObjectInfos.isEmpty() ? -1 : 0, sError);