|
@@ -2242,52 +2242,7 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
m_fieldWidgets.append(unitLabel);
|
|
m_fieldWidgets.append(unitLabel);
|
|
createdWidget = inputWidget;
|
|
createdWidget = inputWidget;
|
|
// // 连接 textChanged 信号到 lambda 函数
|
|
// // 连接 textChanged 信号到 lambda 函数
|
|
- //connect(lineEdit, &QLineEdit::textChanged, [this, lineEdit, fieldTableName, fieldName, fieldUpLimit, fieldDownLimit]() {
|
|
|
|
- // if ((fieldUpLimit != "") && (fieldDownLimit != ""))
|
|
|
|
- // {
|
|
|
|
- // int uplimit = fieldUpLimit.toInt();
|
|
|
|
- // int downlimit = fieldDownLimit.toInt();
|
|
|
|
- // int inputvalue = (lineEdit->text()).toInt();
|
|
|
|
- // if ((inputvalue <= uplimit) && (inputvalue >= downlimit))
|
|
|
|
- // {
|
|
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
|
|
|
|
- // //updateDb(fieldTableName, fieldId, lineEdit->text());
|
|
|
|
- // } else
|
|
|
|
- // {
|
|
|
|
- // lineEdit->setPlaceholderText(tr("超出设定范围,请重新输入"));
|
|
|
|
- // }
|
|
|
|
- // } else if (fieldDownLimit != "")
|
|
|
|
- // {
|
|
|
|
- // int downlimit = fieldDownLimit.toInt();
|
|
|
|
- // int inputvalue = (lineEdit->text()).toInt();
|
|
|
|
- // if (inputvalue >= downlimit)
|
|
|
|
- // {
|
|
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
|
|
|
|
- // //updateDb(fieldTableName, fieldId, lineEdit->text());
|
|
|
|
- // } else
|
|
|
|
- // {
|
|
|
|
- // lineEdit->setPlaceholderText(tr("超出设定范围,请重新输入"));
|
|
|
|
- // }
|
|
|
|
- // } else if (fieldUpLimit != "")
|
|
|
|
- // {
|
|
|
|
- // int uplimit = fieldUpLimit.toInt();
|
|
|
|
- // int inputvalue = (lineEdit->text()).toInt();
|
|
|
|
- // if (inputvalue <= uplimit)
|
|
|
|
- // {
|
|
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
|
|
|
|
- // //updateDb(fieldTableName, fieldId, lineEdit->text());
|
|
|
|
- // } else
|
|
|
|
- // {
|
|
|
|
- // lineEdit->setPlaceholderText(tr("超出设定范围,请重新输入"));
|
|
|
|
- // }
|
|
|
|
- // } else
|
|
|
|
- // {
|
|
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
|
|
|
|
- // //updateDb(fieldTableName, fieldId, lineEdit->text());
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // });
|
|
|
|
- connect(lineEdit, &QLineEdit::textChanged, [this, fieldType,lineEdit, fieldUpLimit, fieldDownLimit, pFieldDescribeLabel]() {
|
|
|
|
|
|
+ connect(lineEdit, &QLineEdit::textChanged, [this, fieldType,lineEdit, fieldUpLimit, fieldDownLimit, pFieldDescribeLabel,fieldValue]() {
|
|
if ((fieldUpLimit != "") && (fieldDownLimit != ""))
|
|
if ((fieldUpLimit != "") && (fieldDownLimit != ""))
|
|
{
|
|
{
|
|
if (fieldType == "LONG")
|
|
if (fieldType == "LONG")
|
|
@@ -2301,8 +2256,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
|
|
|
|
- //updateDb(fieldTableName, fieldId, lineEdit->text());
|
|
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -2403,9 +2356,14 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
// m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
|
|
// m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
|
|
//updateDb(fieldTableName, fieldId, lineEdit->text());
|
|
//updateDb(fieldTableName, fieldId, lineEdit->text());
|
|
}
|
|
}
|
|
|
|
+ if (fieldValue == lineEdit->text()) {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ modifiedLabels.remove(pFieldDescribeLabel);
|
|
|
|
+ }
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
if (modifiedLabels.contains(pFieldDescribeLabel)) {
|
|
if (modifiedLabels.contains(pFieldDescribeLabel)) {
|
|
m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
|
|
m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
|
|
@@ -2436,33 +2394,20 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
lineEdit1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
lineEdit1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
lineEdit1->setFixedSize(140, 28);
|
|
lineEdit1->setFixedSize(140, 28);
|
|
lineEdit1->setAlignment(Qt::AlignLeft);
|
|
lineEdit1->setAlignment(Qt::AlignLeft);
|
|
- /*lineEdit1->setStyleSheet(R"(
|
|
|
|
- QLineEdit {
|
|
|
|
- background: #FFFFFF;
|
|
|
|
- border: 1px solid #BABBDC;
|
|
|
|
- border-radius: 6px;
|
|
|
|
- padding: 2px 5px;
|
|
|
|
- }
|
|
|
|
- QLineEdit:disabled {
|
|
|
|
- background: #eeeeee;
|
|
|
|
- }
|
|
|
|
- )");*/
|
|
|
|
|
|
+
|
|
rightLayout->addWidget(lineEdit1);
|
|
rightLayout->addWidget(lineEdit1);
|
|
createdWidget = lineEdit1;
|
|
createdWidget = lineEdit1;
|
|
- // // 连接 textChanged 信号到 lambda 函数
|
|
|
|
- //connect(lineEdit1, &QLineEdit::textChanged, [this, lineEdit1, fieldTableName, fieldName]() {
|
|
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit1->text());
|
|
|
|
- // //updateDb(fieldTableName, fieldId, lineEdit1->text());
|
|
|
|
- // loginput(fieldTableName, fieldName, lineEdit1->text());
|
|
|
|
- // });
|
|
|
|
- connect(lineEdit1, &QLineEdit::textChanged, [this, lineEdit1, pFieldDescribeLabel]() {
|
|
|
|
|
|
+ // 连接 textChanged 信号到 lambda 函数
|
|
|
|
+
|
|
|
|
+ connect(lineEdit1, &QLineEdit::textChanged, [this, lineEdit1, pFieldDescribeLabel, fieldValue]() {
|
|
pFieldDescribeLabel->setProperty("value", lineEdit1->text());
|
|
pFieldDescribeLabel->setProperty("value", lineEdit1->text());
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit1->text());
|
|
|
|
- //updateDb(fieldTableName, fieldId, lineEdit1->text());
|
|
|
|
- // loginput(fieldTableName, fieldName, lineEdit1->text());
|
|
|
|
|
|
+ if (fieldValue == lineEdit1->text()) {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ modifiedLabels.remove(pFieldDescribeLabel);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
@@ -2520,23 +2465,17 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 使用Lambda函数连接 buttonToggled 信号
|
|
// 使用Lambda函数连接 buttonToggled 信号
|
|
- //connect(radioGroup, static_cast<void (QButtonGroup::*)(QAbstractButton*, bool)>(&QButtonGroup::buttonToggled), [this, fieldTableName, fieldName](QAbstractButton* button, bool checked) {
|
|
|
|
- // if (checked)
|
|
|
|
- // {
|
|
|
|
- // // qDebug() << "Button toggled:" << button->text();
|
|
|
|
- // // 在这里添加你想要执行的操作
|
|
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, button->text());
|
|
|
|
- // //updateDb(fieldTableName, fieldId, button->text());
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- connect(radioGroup, static_cast<void (QButtonGroup::*)(QAbstractButton*, bool)>(&QButtonGroup::buttonToggled), [this, pFieldDescribeLabel](QAbstractButton* button, bool checked) {
|
|
|
|
|
|
+ connect(radioGroup, static_cast<void (QButtonGroup::*)(QAbstractButton*, bool)>(&QButtonGroup::buttonToggled), [this, pFieldDescribeLabel, fieldValue](QAbstractButton* button, bool checked) {
|
|
if (checked)
|
|
if (checked)
|
|
{
|
|
{
|
|
pFieldDescribeLabel->setProperty("value", button->text());
|
|
pFieldDescribeLabel->setProperty("value", button->text());
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
- // qDebug() << "Button toggled:" << button->text();
|
|
|
|
|
|
+ if (fieldValue == button->text()) {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ modifiedLabels.remove(pFieldDescribeLabel);
|
|
|
|
+ }
|
|
// 在这里添加你想要执行的操作
|
|
// 在这里添加你想要执行的操作
|
|
// m_sqlOper->updateControlData(fieldTableName, fieldName, button->text());
|
|
// m_sqlOper->updateControlData(fieldTableName, fieldName, button->text());
|
|
//updateDb(fieldTableName, fieldId, button->text());
|
|
//updateDb(fieldTableName, fieldId, button->text());
|
|
@@ -2600,38 +2539,20 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
QCheckBox* checkBox = new QCheckBox;
|
|
QCheckBox* checkBox = new QCheckBox;
|
|
checkBox->setChecked(isChecked);
|
|
checkBox->setChecked(isChecked);
|
|
checkBox->setProperty("type", "checkBox");
|
|
checkBox->setProperty("type", "checkBox");
|
|
- /*checkBox->setStyleSheet(R"(
|
|
|
|
- QCheckBox::indicator {
|
|
|
|
- width: 20px;
|
|
|
|
- height: 20px;
|
|
|
|
- }
|
|
|
|
- QCheckBox::indicator:unchecked {
|
|
|
|
- background-color: #FFFFFF;
|
|
|
|
- border: 1px solid #BABBDC;
|
|
|
|
- border-radius: 2px;
|
|
|
|
- }
|
|
|
|
- QCheckBox::indicator:checked {
|
|
|
|
- image: url(:/images/three_Selecte.png);
|
|
|
|
- }
|
|
|
|
- QCheckBox {
|
|
|
|
- spacing: 0px;
|
|
|
|
- }
|
|
|
|
- QCheckBox::indicator:disabled {
|
|
|
|
- background-color: #eeeeee;
|
|
|
|
- }
|
|
|
|
- )");*/
|
|
|
|
rightLayout->addWidget(checkBox);
|
|
rightLayout->addWidget(checkBox);
|
|
createdWidget = checkBox;
|
|
createdWidget = checkBox;
|
|
- connect(checkBox, &QCheckBox::stateChanged, [this, pFieldDescribeLabel](int state)
|
|
|
|
|
|
+ connect(checkBox, &QCheckBox::stateChanged, [this, pFieldDescribeLabel,fieldValue](int state)
|
|
{
|
|
{
|
|
if (state == Qt::Checked)
|
|
if (state == Qt::Checked)
|
|
{
|
|
{
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, "1");
|
|
|
|
- //updateDb(fieldTableName, fieldId, "1");
|
|
|
|
|
|
+
|
|
pFieldDescribeLabel->setProperty("value", "1");
|
|
pFieldDescribeLabel->setProperty("value", "1");
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
- //label->setStyleSheet("color: #5c63be;");
|
|
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
|
|
+ if (fieldValue == "1") {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ modifiedLabels.remove(pFieldDescribeLabel);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else if (state == Qt::Unchecked)
|
|
else if (state == Qt::Unchecked)
|
|
{
|
|
{
|
|
@@ -2642,6 +2563,10 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
|
|
+ if (fieldValue != "1") {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ modifiedLabels.remove(pFieldDescribeLabel);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else if (state == Qt::PartiallyChecked)
|
|
else if (state == Qt::PartiallyChecked)
|
|
{
|
|
{
|
|
@@ -2711,34 +2636,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
QComboBox* comboBox = new QComboBox;
|
|
QComboBox* comboBox = new QComboBox;
|
|
comboBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
comboBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
comboBox->setFixedSize(140, 28);
|
|
comboBox->setFixedSize(140, 28);
|
|
- /*comboBox->setStyleSheet(R"(
|
|
|
|
- QComboBox {
|
|
|
|
- background: #FFFFFF;
|
|
|
|
- border: 1px solid #BABBDC;
|
|
|
|
- border-radius: 6px;
|
|
|
|
- padding: 2px 5px;
|
|
|
|
- }
|
|
|
|
- QComboBox::drop-down {
|
|
|
|
- width: 20px;
|
|
|
|
- }
|
|
|
|
- QComboBox::disabled {
|
|
|
|
- background-color: #eeeeee;
|
|
|
|
- }
|
|
|
|
- )");*/
|
|
|
|
- // int newIndex = -1;
|
|
|
|
- /*for (const QString& opt : optionList)
|
|
|
|
- {
|
|
|
|
- QString trimmedOpt = opt.trimmed();
|
|
|
|
- if (!trimmedOpt.isEmpty())
|
|
|
|
- comboBox->addItem(trimmedOpt);
|
|
|
|
- }
|
|
|
|
- if (fieldValue == "")
|
|
|
|
- {
|
|
|
|
- comboBox->setCurrentIndex(0);
|
|
|
|
- } else
|
|
|
|
- {
|
|
|
|
- comboBox->setCurrentIndex(fieldValue.toInt());
|
|
|
|
- }*/
|
|
|
|
int matchedIndex = -1;
|
|
int matchedIndex = -1;
|
|
int currentIndex = 0;
|
|
int currentIndex = 0;
|
|
|
|
|
|
@@ -2760,16 +2657,8 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
rightLayout->addWidget(comboBox);
|
|
rightLayout->addWidget(comboBox);
|
|
createdWidget = comboBox;
|
|
createdWidget = comboBox;
|
|
// 使用Lambda函数连接 currentIndexChanged 信号
|
|
// 使用Lambda函数连接 currentIndexChanged 信号
|
|
- //connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [this, comboBox, fieldTableName, fieldName](int index) {
|
|
|
|
- // QString selectedText = comboBox->itemText(index);
|
|
|
|
- // QString indexString = QString::number(index);
|
|
|
|
- // // qDebug() << "ComboBox index changed to:" << index << "Text:" << selectedText;
|
|
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, indexString);
|
|
|
|
- // //updateDb(fieldTableName, fieldId, indexString);
|
|
|
|
- // // 在这里添加你想要执行的操作
|
|
|
|
- // });
|
|
|
|
connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
- [this, comboBox, jsonArray, pFieldDescribeLabel](int index)
|
|
|
|
|
|
+ [this, comboBox, jsonArray, pFieldDescribeLabel, fieldValue](int index)
|
|
{
|
|
{
|
|
QString selectedText = comboBox->itemText(index);
|
|
QString selectedText = comboBox->itemText(index);
|
|
QString valueString;
|
|
QString valueString;
|
|
@@ -2787,6 +2676,11 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
//label->setStyleSheet("color: #5c63be;");
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
|
|
+ if (selectedText == fieldValue.trimmed())
|
|
|
|
+ {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ modifiedLabels.remove(pFieldDescribeLabel);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
@@ -2842,34 +2736,24 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
QTimeEdit* timeEdit = new QTimeEdit;
|
|
QTimeEdit* timeEdit = new QTimeEdit;
|
|
timeEdit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
timeEdit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
timeEdit->setFixedSize(120, 28);
|
|
timeEdit->setFixedSize(120, 28);
|
|
- /*timeEdit->setStyleSheet(R"(
|
|
|
|
- QTimeEdit {
|
|
|
|
- background: #FFFFFF;
|
|
|
|
- border: 1px solid #BABBDC;
|
|
|
|
- border-radius: 6px;
|
|
|
|
- padding: 2px 5px;
|
|
|
|
- }
|
|
|
|
- QTimeEdit::disabled {
|
|
|
|
- background-color: #eeeeee;
|
|
|
|
- }
|
|
|
|
- )");*/
|
|
|
|
timeEdit->setDisplayFormat("HH:mm:ss");
|
|
timeEdit->setDisplayFormat("HH:mm:ss");
|
|
timeEdit->setTime(QTime::fromString(fieldValue, "HH:mm:ss"));
|
|
timeEdit->setTime(QTime::fromString(fieldValue, "HH:mm:ss"));
|
|
rightLayout->addWidget(timeEdit);
|
|
rightLayout->addWidget(timeEdit);
|
|
createdWidget = timeEdit;
|
|
createdWidget = timeEdit;
|
|
- connect(timeEdit, &QTimeEdit::timeChanged, [this, timeEdit, pFieldDescribeLabel]() {
|
|
|
|
|
|
+ connect(timeEdit, &QTimeEdit::timeChanged, [this, timeEdit, pFieldDescribeLabel, fieldValue]() {
|
|
QString timeString = timeEdit->time().toString("HH:mm:ss");
|
|
QString timeString = timeEdit->time().toString("HH:mm:ss");
|
|
pFieldDescribeLabel->setProperty("value", timeString);
|
|
pFieldDescribeLabel->setProperty("value", timeString);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
- //label->setStyleSheet("color: #5c63be;");
|
|
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
|
|
+ if (fieldValue == timeString) {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
if (modifiedLabels.contains(pFieldDescribeLabel)) {
|
|
if (modifiedLabels.contains(pFieldDescribeLabel)) {
|
|
m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
|
|
m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
|
|
pFieldDescribeLabel->setDisabled(false);
|
|
pFieldDescribeLabel->setDisabled(false);
|
|
- //label->setStyleSheet("color: black;");
|
|
|
|
modifiedLabels.remove(pFieldDescribeLabel);
|
|
modifiedLabels.remove(pFieldDescribeLabel);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -2904,23 +2788,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
switchBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
switchBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
switchBox->setFixedSize(30, 30);
|
|
switchBox->setFixedSize(30, 30);
|
|
switchBox->setProperty("type", "switch");
|
|
switchBox->setProperty("type", "switch");
|
|
- /*switchBox->setStyleSheet(R"(
|
|
|
|
- QCheckBox::indicator {
|
|
|
|
- width: 30px;
|
|
|
|
- height: 30px;
|
|
|
|
- }
|
|
|
|
- QCheckBox::indicator:unchecked {
|
|
|
|
- background-color: #BABBDC;
|
|
|
|
- border-radius: 6px;
|
|
|
|
- }
|
|
|
|
- QCheckBox::indicator:checked {
|
|
|
|
- background-color: #4CAF50;
|
|
|
|
- border-radius: 6px;
|
|
|
|
- }
|
|
|
|
- QCheckBox::indicator:disabled {
|
|
|
|
- background-color: #eeeeee;
|
|
|
|
- }
|
|
|
|
- )");*/
|
|
|
|
QString switchValue;
|
|
QString switchValue;
|
|
|
|
|
|
if (fieldValue == "")
|
|
if (fieldValue == "")
|
|
@@ -2941,48 +2808,37 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
}
|
|
}
|
|
QLabel* switchLabel = new QLabel(switchBox->isChecked() ? tr("Open","开") :tr("Close","关"));
|
|
QLabel* switchLabel = new QLabel(switchBox->isChecked() ? tr("Open","开") :tr("Close","关"));
|
|
switchLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
|
|
switchLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
|
|
- //switchLabel->setStyleSheet("font-size: 14px;");
|
|
|
|
- //connect(switchBox, &QCheckBox::stateChanged, [fieldTableName, fieldName, switchLabel, this](int state) {
|
|
|
|
- // if (state == Qt::Checked)
|
|
|
|
- // {
|
|
|
|
- // switchLabel->setText(tr("开"));
|
|
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, "on");
|
|
|
|
- // //updateDb(fieldTableName, fieldId, "on");
|
|
|
|
- // } else
|
|
|
|
- // {
|
|
|
|
- // switchLabel->setText(tr("关"));
|
|
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, "off");
|
|
|
|
- // //updateDb(fieldTableName, fieldId, "off");
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- connect(switchBox, &QCheckBox::stateChanged, [switchLabel, this, pFieldDescribeLabel](int state) {
|
|
|
|
|
|
+
|
|
|
|
+ connect(switchBox, &QCheckBox::stateChanged, [switchLabel, this, pFieldDescribeLabel, fieldValue](int state) {
|
|
if (state == Qt::Checked)
|
|
if (state == Qt::Checked)
|
|
{
|
|
{
|
|
switchLabel->setText(tr("Open","开"));
|
|
switchLabel->setText(tr("Open","开"));
|
|
pFieldDescribeLabel->setProperty("value", "on");
|
|
pFieldDescribeLabel->setProperty("value", "on");
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
- //label->setStyleSheet("color: #5c63be;");
|
|
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, "on");
|
|
|
|
- //updateDb(fieldTableName, fieldId, "on");
|
|
|
|
|
|
+ if (fieldValue.toLower() == "on") {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ modifiedLabels.remove(pFieldDescribeLabel);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
switchLabel->setText(tr("Close","关"));
|
|
switchLabel->setText(tr("Close","关"));
|
|
pFieldDescribeLabel->setProperty("value", "off");
|
|
pFieldDescribeLabel->setProperty("value", "off");
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
- //label->setStyleSheet("color: #5c63be;");
|
|
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
- // m_sqlOper->updateControlData(fieldTableName, fieldName, "off");
|
|
|
|
- //updateDb(fieldTableName, fieldId, "off");
|
|
|
|
|
|
+ if (fieldValue.toLower() != "on") {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ modifiedLabels.remove(pFieldDescribeLabel);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
});
|
|
});
|
|
|
|
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
if (modifiedLabels.contains(pFieldDescribeLabel)) {
|
|
if (modifiedLabels.contains(pFieldDescribeLabel)) {
|
|
m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
|
|
m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
|
|
pFieldDescribeLabel->setDisabled(false);
|
|
pFieldDescribeLabel->setDisabled(false);
|
|
- //label->setStyleSheet("color: black;");
|
|
|
|
modifiedLabels.remove(pFieldDescribeLabel);
|
|
modifiedLabels.remove(pFieldDescribeLabel);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -3062,11 +2918,14 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
|
|
|
|
m_veCombinedCont.push_back(_a);
|
|
m_veCombinedCont.push_back(_a);
|
|
|
|
|
|
- connect(comboInput, &QLineEdit::textChanged, [this, comboInput, pFieldDescribeLabel]() {
|
|
|
|
|
|
+ connect(comboInput, &QLineEdit::textChanged, [this, comboInput, pFieldDescribeLabel, inputText]() {
|
|
pFieldDescribeLabel->setProperty("value", comboInput->text());
|
|
pFieldDescribeLabel->setProperty("value", comboInput->text());
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
pFieldDescribeLabel->setDisabled(true);
|
|
- //label->setStyleSheet("color: #5c63be;");
|
|
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
modifiedLabels.insert(pFieldDescribeLabel);
|
|
|
|
+ if (comboInput->text().trimmed() == inputText.trimmed()) {
|
|
|
|
+ pFieldDescribeLabel->setDisabled(false);
|
|
|
|
+ modifiedLabels.remove(pFieldDescribeLabel);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
connect(this, &DbTreeViewManager::saveClicked, [this, fieldTableName, fieldName, pFieldDescribeLabel]() {
|
|
@@ -3074,7 +2933,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
{
|
|
{
|
|
m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
|
|
m_sqlOper->updateControlData(fieldTableName, fieldName, pFieldDescribeLabel->property("value").toString());
|
|
pFieldDescribeLabel->setDisabled(false);
|
|
pFieldDescribeLabel->setDisabled(false);
|
|
- //label->setStyleSheet("color: black;");
|
|
|
|
modifiedLabels.remove(pFieldDescribeLabel);
|
|
modifiedLabels.remove(pFieldDescribeLabel);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -3090,12 +2948,6 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
|
|
}
|
|
}
|
|
|
|
|
|
comboInput->setText(QString::number(strNum, 'f', 2));
|
|
comboInput->setText(QString::number(strNum, 'f', 2));
|
|
- //QPushButton* senderBtn = qobject_cast<QPushButton*>(sender());
|
|
|
|
- //if (senderBtn) {
|
|
|
|
- // QString strOnclick = senderBtn->property("Get").toString();
|
|
|
|
- // qDebug() << "Clicked ID:" << strOnclick;
|
|
|
|
- //}
|
|
|
|
- // JMessageTip::Message_question(m_veCombinedCont[0].pLineC->text());
|
|
|
|
}, [this, comboInput, strstrModuleType, strAxisType, fieldTableName, fieldName]()
|
|
}, [this, comboInput, strstrModuleType, strAxisType, fieldTableName, fieldName]()
|
|
{
|
|
{
|
|
QPushButton* senderBtn = qobject_cast<QPushButton*>(sender());
|
|
QPushButton* senderBtn = qobject_cast<QPushButton*>(sender());
|