Ver Fonte

修复节域值计算错误

Ulric há 2 dias atrás
pai
commit
8538ab3b34
1 ficheiros alterados com 5 adições e 2 exclusões
  1. 5 2
      QFD/widgets/MatterElementConfigWidget.cpp

+ 5 - 2
QFD/widgets/MatterElementConfigWidget.cpp

@@ -609,6 +609,7 @@ void MatterElementConfigWidget::onTableItemChanged(QStandardItem *item)
     }
 
     /// 求节域值
+
     QString left1, right1, left2, right2;
     QString sep = ", ";
     if (item1->text().length() > 2 && item1->text().contains(sep)) {
@@ -620,8 +621,10 @@ void MatterElementConfigWidget::onTableItemChanged(QStandardItem *item)
         right2 = item2->text().mid(1, item2->text().length() - 2).split(sep).last();
     }
     QString range = QString("(%1, %2)").arg(left1).arg(right2);
-    if (left1.toDouble() > right2.toDouble()) {
-        //        range = QString("(%1, %2)").arg(right1).arg(left2);
+    if (left1.toDouble() < left2.toDouble()) {
+        range = QString("%1%2%3").arg(item1->text().split(sep).first()).arg(sep).arg(item2->text().split(sep).last());
+    } else {
+        range = QString("%1%2%3").arg(item2->text().split(sep).first()).arg(sep).arg(item1->text().split(sep).last());
     }
 
     /// 显示节域值