Browse Source

评估方案规划

chengxr 1 year ago
parent
commit
c51cfb2216

+ 17 - 0
QFD/CCanvas/CLineItem.cpp

@@ -42,6 +42,16 @@ void CLineItem::setLineType(CLineItem::CLineType type)
     updatePath();
 }
 
+bool CLineItem::showArrow() const
+{
+    return m_showArrow;
+}
+
+void CLineItem::setShowArrow(bool s)
+{
+    m_showArrow = s;
+}
+
 void CLineItem::updatePath()
 {
     QPainterPath path;
@@ -77,5 +87,12 @@ void CLineItem::updatePath()
         break;
     }
     }
+
+    if (m_showArrow && m_startPos != m_endPos) {
+        path.moveTo(m_endPos + QPointF(-10, -5));
+        path.lineTo(m_endPos);
+        path.lineTo(m_endPos + QPointF(-10, 5));
+    }
+
     setPath(path);
 }

+ 5 - 0
QFD/CCanvas/CLineItem.h

@@ -28,6 +28,10 @@ public:
 
     void setLineType(CLineType type);
 
+    bool showArrow() const;
+
+    void setShowArrow(bool s);
+
     void updatePath() override;
 
 private:
@@ -35,6 +39,7 @@ private:
     QPointF m_endPos;
 
     CLineType m_lineType = Curve;
+    bool m_showArrow     = false;
 };
 
 #endif  // CLINEITEM_H

+ 1 - 0
QFD/CCanvas/CSchemeItem.cpp

@@ -9,6 +9,7 @@ CSchemeItem::CSchemeItem(const QString text, QObject *parent) : QObject(parent)
     m_rectItem = new CRectItem();
     m_textItem = new CTextItem(text, m_rectItem);
     m_lineItem = new CLineItem(m_rectItem);
+    m_lineItem->setShowArrow(true);
 
     setMinHeight(100);
     m_textItem->setAllowEdit(false);

+ 1 - 3
QFD/widgets/EvalSchemeWidget.cpp

@@ -14,8 +14,6 @@
 QString EvalSchemeWidget::nameOfScheme(Scheme s)
 {
     switch (s) {
-    case Input:
-        return "输入";
     case Index:
         return "构建指标体系";
     case Collect:
@@ -111,7 +109,7 @@ void EvalSchemeWidget::refreshSchemeView()
 
 void EvalSchemeWidget::testData()
 {
-    m_scheme = Input | Index | Collect | Output;
+    m_scheme = Index | Collect | Output;
     m_algs   = { Alg1 };
     refreshSchemeView();
 }

+ 0 - 1
QFD/widgets/EvalSchemeWidget.h

@@ -21,7 +21,6 @@ class EvalSchemeWidget : public EvalWidget
 public:
     enum Scheme
     {
-        Input   = 0b1,
         Index   = 0b1 << 1,
         Collect = 0b1 << 2,
         Process = 0b1 << 3,