1、完善选择井的dialog视图;

feature/ribbon-menu-20240927
simonyan 3 weeks ago
parent 6436e4a057
commit da4f45b2fe

File diff suppressed because one or more lines are too long

@ -195,8 +195,11 @@
<Cmd ID="5201" Bounds="0,0,2,1" Name="PVTManager" Alias="PVT" Icon="JobNew" /> <Cmd ID="5201" Bounds="0,0,2,1" Name="PVTManager" Alias="PVT" Icon="JobNew" />
<Cmd ID="5202" Bounds="0,1,2,1" Name="PPManager" Alias="相渗" Icon="JobNew" /> <Cmd ID="5202" Bounds="0,1,2,1" Name="PPManager" Alias="相渗" Icon="JobNew" />
</Group> </Group>
<Group Name="CC" Alias="油藏特性">
<Cmd ID="5801" Bounds="0,0,2,1" Name="PVTManager" Alias="储层特性" Icon="JobNew" />
</Group>
<Group Name="NtInit" Alias="油气藏初始化"> <Group Name="NtInit" Alias="油藏地图">
<Cmd ID="5301" Bounds="0,0,2,1" Name="Lock" Alias="锁定模式" Icon="NmDemo" /> <Cmd ID="5301" Bounds="0,0,2,1" Name="Lock" Alias="锁定模式" Icon="NmDemo" />
<Cmd ID="5302" Bounds="0,1,2,1" Name="TODO1" Alias="地质图导入" Icon="Time" /> <Cmd ID="5302" Bounds="0,1,2,1" Name="TODO1" Alias="地质图导入" Icon="Time" />
<Cmd ID="5303" Bounds="0,2,2,1" Name="TODO2" Alias="地质图隐藏" Icon="Time" /> <Cmd ID="5303" Bounds="0,2,2,1" Name="TODO2" Alias="地质图隐藏" Icon="Time" />
@ -216,6 +219,9 @@
<Group Name="NtGrid" Alias="网格"> <Group Name="NtGrid" Alias="网格">
<Cmd ID="5401" Bounds="0,0,2,1" Name="WellGrid" Alias="网格生成" Icon="PrepareGrid" /> <Cmd ID="5401" Bounds="0,0,2,1" Name="WellGrid" Alias="网格生成" Icon="PrepareGrid" />
</Group> </Group>
<Group Name="NtSolver" Alias="求解及分析">
<Cmd ID="5701" Bounds="0,0,2,1" Name="Solver" Alias="求解及分析" Icon="PrepareGrid" />
</Group>
<Group Name="NtPostprocessing" Alias="后处理"> <Group Name="NtPostprocessing" Alias="后处理">
<Cmd ID="5601" Bounds="0,0,2,1" Name="Postprocessing" Alias="后处理" Icon="PrepareGrid" /> <Cmd ID="5601" Bounds="0,0,2,1" Name="Postprocessing" Alias="后处理" Icon="PrepareGrid" />

@ -42,8 +42,10 @@ void nmWxPostprocessingWidget::initLayout()
this->setLayout(m_mainLayout); this->setLayout(m_mainLayout);
QFrame* frame = new QFrame; QFrame* frame = new QFrame;
m_frameLaoyt = new QVBoxLayout; m_frameLaoyt = new QVBoxLayout;
m_frameLaoyt->setMargin(0);
frame->setLayout(m_frameLaoyt); frame->setLayout(m_frameLaoyt);
m_mainLayout->addWidget(frame); m_mainLayout->addWidget(frame);
m_mainLayout->setMargin(0);
qDebug() << "in initLayout"; qDebug() << "in initLayout";
} }

@ -4,7 +4,10 @@
#include <QEvent> #include <QEvent>
#include <QStringList> #include <QStringList>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QVBoxLayout>
#include <QGridLayout>
#include <QMouseEvent> #include <QMouseEvent>
#include <QLabel>
#include <QDebug> #include <QDebug>
#include <QListWidget> #include <QListWidget>
#include "nmData/nmDataLogFile.h" #include "nmData/nmDataLogFile.h"
@ -15,10 +18,13 @@ nmWxSelectWellsWidget::nmWxSelectWellsWidget(QWidget* aParent) :
m_pListWidget(new QListWidget(this)), m_pListWidget(new QListWidget(this)),
m_pLineEdit(new QTextEdit(this)) m_pLineEdit(new QTextEdit(this))
{ {
QVBoxLayout* layout = new QVBoxLayout; // 主布局
layout->addWidget(m_pLineEdit); QGridLayout* layout = new QGridLayout;
layout->addWidget(m_pListWidget);
this->setLayout(layout); this->setLayout(layout);
layout->addWidget(new QLabel(tr("Select Wells: ")), 0, 0);
layout->addWidget(m_pListWidget, 1, 0);
layout->addWidget(new QLabel(tr("Selected Wells: ")), 0, 1);
layout->addWidget(m_pLineEdit, 1, 1);
// m_pLineEdit->setText(multiLineText); // m_pLineEdit->setText(multiLineText);
m_pLineEdit->setReadOnly(true); m_pLineEdit->setReadOnly(true);
} }
@ -39,8 +45,11 @@ void nmWxSelectWellsWidget::addItem(QString name, QVariant value)
m_values.append(value); m_values.append(value);
nmWxSelectWellItemWidget* itemWidget = new nmWxSelectWellItemWidget(NULL, name, value); nmWxSelectWellItemWidget* itemWidget = new nmWxSelectWellItemWidget(NULL, name, value);
itemWidget->setFixedHeight(25); itemWidget->setFixedHeight(25);
QListWidgetItem* item = new QListWidgetItem(m_pListWidget); itemWidget->setFixedWidth(200);
item->setSizeHint(QSize(item->sizeHint().width(), 25)); // itemWidget->setMinimumWidth(m_pListWidget->viewport()->width()); // 设置widget的最小宽度为列表视图的宽度
QListWidgetItem* item = new QListWidgetItem;
nmDataLogFile::getInstance()->writeLog(QString(" %1 ").arg(item->sizeHint().width()));
item->setSizeHint(QSize(200, 30));
m_pListWidget->addItem(item); m_pListWidget->addItem(item);
m_pListWidget->setItemWidget(item, itemWidget); m_pListWidget->setItemWidget(item, itemWidget);
connect(itemWidget, SIGNAL(sigItemClicked()), this, SLOT(onUpdateSelections())); connect(itemWidget, SIGNAL(sigItemClicked()), this, SLOT(onUpdateSelections()));
@ -61,7 +70,7 @@ void nmWxSelectWellsWidget::onUpdateSelections()
nameList.append(m_items[i]); nameList.append(m_items[i]);
} }
} }
m_pLineEdit->setPlainText(nameList.join(",")); m_pLineEdit->setPlainText(nameList.join("\n"));
} }

Loading…
Cancel
Save