|
|
|
@ -2,6 +2,7 @@
|
|
|
|
#include "iGridRowGroup.h"
|
|
|
|
#include "iGridRowGroup.h"
|
|
|
|
#include "iParameter.h"
|
|
|
|
#include "iParameter.h"
|
|
|
|
#include "iSysParaHelper.h"
|
|
|
|
#include "iSysParaHelper.h"
|
|
|
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
|
|
|
|
|
|
|
// 井编码可能互为前缀,拆分参数时必须优先匹配更长的编码。
|
|
|
|
// 井编码可能互为前缀,拆分参数时必须优先匹配更长的编码。
|
|
|
|
static bool longerStringFirst(const QString& a, const QString& b)
|
|
|
|
static bool longerStringFirst(const QString& a, const QString& b)
|
|
|
|
@ -93,7 +94,7 @@ bool nmGridRowUtils::buildRowUtils(QStringList listParas,
|
|
|
|
|
|
|
|
|
|
|
|
// 对象分组追加完成后,重新备份、绑定、计算布局。
|
|
|
|
// 对象分组追加完成后,重新备份、绑定、计算布局。
|
|
|
|
bkAllItems();
|
|
|
|
bkAllItems();
|
|
|
|
bindItems();
|
|
|
|
dealwithItemBinds();
|
|
|
|
|
|
|
|
|
|
|
|
double h = getUtilHeight();
|
|
|
|
double h = getUtilHeight();
|
|
|
|
QRectF rt = QRectF(0, 0, 300, h);
|
|
|
|
QRectF rt = QRectF(0, 0, 300, h);
|
|
|
|
@ -101,6 +102,8 @@ bool nmGridRowUtils::buildRowUtils(QStringList listParas,
|
|
|
|
setMinimumHeight(h);
|
|
|
|
setMinimumHeight(h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connectUnitEditorCommitSignals();
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -269,9 +272,47 @@ void nmGridRowUtils::connectSignalsOf(iGridRowItem* p)
|
|
|
|
iGridRowUtils::connectSignalsOf(p);
|
|
|
|
iGridRowUtils::connectSignalsOf(p);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void nmGridRowUtils::bindItems()
|
|
|
|
void nmGridRowUtils::dealwithItemBinds()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
iGridRowUtils::dealwithItemBinds();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void nmGridRowUtils::connectUnitEditorCommitSignals()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
iGridRowUtils::bindItems();
|
|
|
|
foreach (iGridRowItem* pItem, m_vecAllItems)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
iGridRowItemUnt* pUnitItem = qobject_cast<iGridRowItemUnt*>(pItem);
|
|
|
|
|
|
|
|
if (pUnitItem == nullptr)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QLineEdit* pEditor = qobject_cast<QLineEdit*>(pUnitItem->getMainEditor());
|
|
|
|
|
|
|
|
if (pEditor == nullptr || m_mapUnitEditorItems.contains(pEditor))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_mapUnitEditorItems.insert(pEditor, pUnitItem);
|
|
|
|
|
|
|
|
connect(pEditor, SIGNAL(editingFinished()),
|
|
|
|
|
|
|
|
this, SLOT(slotUnitEditorEditingFinished()),
|
|
|
|
|
|
|
|
Qt::QueuedConnection);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void nmGridRowUtils::slotUnitEditorEditingFinished()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QLineEdit* pEditor = qobject_cast<QLineEdit*>(sender());
|
|
|
|
|
|
|
|
iGridRowItemUnt* pUnitItem = m_mapUnitEditorItems.value(pEditor, nullptr);
|
|
|
|
|
|
|
|
if (pEditor == nullptr || pUnitItem == nullptr)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Binder在editingFinished中更新基准值;排队到其后再走参数项原有提交通道。
|
|
|
|
|
|
|
|
QMetaObject::invokeMethod(pUnitItem, "slotItemValueChanged",
|
|
|
|
|
|
|
|
Qt::DirectConnection,
|
|
|
|
|
|
|
|
Q_ARG(QString, pEditor->text()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ================================================================
|
|
|
|
// ================================================================
|
|
|
|
|