chengxr 1 năm trước cách đây
mục cha
commit
6acfc79aab

+ 1 - 4
QFD/CCanvas/CMindView.cpp

@@ -98,8 +98,6 @@ void CMindView::refreshItems()
     }
     m_items.clear();
 
-    qDebug() << __FUNCTION__ << __LINE__ << m_group->boundingRect() << m_group->pos() << endl;
-
     refreshNodeGeometry(m_root);
     collectItems(m_root);
     for (QGraphicsItem *item : m_items) {
@@ -267,11 +265,10 @@ void CMindView::slotTextChanged()
 {
     CNodeItem *item = (CNodeItem *)sender();
     refreshItems();
-    qDebug() << __FUNCTION__ << __LINE__ << item->data().name << endl;
+    emit sigNodeChanged(item->data());
 }
 
 void CMindView::slotWillBeginEditing()
 {
     m_root->endEditing();
-    //    refreshItems();
 }

+ 2 - 0
QFD/CCanvas/CMindView.h

@@ -62,6 +62,8 @@ public slots:
 signals:
     void sigAddSubNode(int pNumber);
 
+    void sigNodeChanged(CNodeData n);
+
 private:
     CMind *m_mind = nullptr;
 

+ 6 - 0
QFD/widgets/IndexSystemWidget.cpp

@@ -37,6 +37,7 @@ void IndexSystemWidget::connectSignalsAndSlots()
 {
     connect(m_mindView, &CMindView::sigAddSubNode, this, &IndexSystemWidget::slotAddSubNode);
     connect(m_mindView->mind(), &CMind::sigRemoveNode, this, &IndexSystemWidget::slotRemoveNode);
+    connect(m_mindView, &CMindView::sigNodeChanged, this, &IndexSystemWidget::slotUpdateNode);
 }
 
 void IndexSystemWidget::setType(int type)
@@ -115,6 +116,11 @@ void IndexSystemWidget::slotAddSubNode(int pNumber)
     addNode(n);
 }
 
+void IndexSystemWidget::slotUpdateNode(CNodeData node)
+{
+    bool ret = CNodeDataService().UpdateCNodeData(node);
+}
+
 void IndexSystemWidget::slotRemoveNode(int id)
 {
     removeNode(id);

+ 2 - 0
QFD/widgets/IndexSystemWidget.h

@@ -41,6 +41,8 @@ public slots:
 
     void slotAddSubNode(int pNumber);
 
+    void slotUpdateNode(CNodeData node);
+
     void slotRemoveNode(int id);
 
 private: