|
|
@ -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"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|