|
|
|
@ -8,16 +8,19 @@
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
#include <QListWidget>
|
|
|
|
|
#include "nmData/nmDataLogFile.h"
|
|
|
|
|
#include <QTextEdit>
|
|
|
|
|
|
|
|
|
|
nmWxSelectWellsWidget::nmWxSelectWellsWidget(QWidget* aParent) :
|
|
|
|
|
QWidget(aParent),
|
|
|
|
|
m_pListWidget(new QListWidget(this)),
|
|
|
|
|
m_pLineEdit(new QLineEdit(this))
|
|
|
|
|
m_pLineEdit(new QTextEdit(this))
|
|
|
|
|
{
|
|
|
|
|
QVBoxLayout* layout = new QVBoxLayout;
|
|
|
|
|
layout->addWidget(m_pLineEdit);
|
|
|
|
|
layout->addWidget(m_pListWidget);
|
|
|
|
|
this->setLayout(layout);
|
|
|
|
|
// m_pLineEdit->setText(multiLineText);
|
|
|
|
|
m_pLineEdit->setReadOnly(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxSelectWellsWidget::addItems(QStringList items, QList<QVariant> values)
|
|
|
|
@ -43,6 +46,11 @@ void nmWxSelectWellsWidget::addItem(QString name, QVariant value)
|
|
|
|
|
connect(itemWidget, SIGNAL(sigItemClicked()), this, SLOT(onUpdateSelections()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList nmWxSelectWellsWidget::getItems()
|
|
|
|
|
{
|
|
|
|
|
return m_pLineEdit->toPlainText().split(",");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxSelectWellsWidget::onUpdateSelections()
|
|
|
|
|
{
|
|
|
|
|
QStringList nameList;
|
|
|
|
@ -53,7 +61,7 @@ void nmWxSelectWellsWidget::onUpdateSelections()
|
|
|
|
|
nameList.append(m_items[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m_pLineEdit->setText(nameList.join(","));
|
|
|
|
|
m_pLineEdit->setPlainText(nameList.join(","));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -97,6 +105,9 @@ void nmWxSelectWellItemWidget::initUI()
|
|
|
|
|
m_pCBox = new QCheckBox(this);
|
|
|
|
|
m_pCBox->setText(m_sName);
|
|
|
|
|
layout->setAlignment(Qt::AlignVCenter);
|
|
|
|
|
layout->setContentsMargins(10, 0, 0, 0);
|
|
|
|
|
layout->setSpacing(0);
|
|
|
|
|
connect(m_pCBox, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxSelectWellItemWidget::mousePressEvent(QMouseEvent *event)
|
|
|
|
@ -110,3 +121,8 @@ void nmWxSelectWellItemWidget::mousePressEvent(QMouseEvent *event)
|
|
|
|
|
this->toggleSelected();
|
|
|
|
|
emit this->sigItemClicked();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxSelectWellItemWidget::onStateChanged(int)
|
|
|
|
|
{
|
|
|
|
|
emit this->sigItemClicked();
|
|
|
|
|
}
|
|
|
|
|