Closed bgao closed 1 year ago
Could you please describe your issue in a couple of words?
Thanks
Could you please describe your issue in a couple of words?
Thanks
Sure.
The old behavior: Once the Node is created, if the underlying NodeModel is changed, which may change the inputs/outputs of the node, the geometry size and number of connectors of the node in the editor won't change to reflect the NodeModel change.
With the proposed changes:
If the NodeModel is changed, user can call updateNodeState()
from Node and the geometry size and corresponding connectors will be updated to reflect the NodeModel change.
Please look at the implementation of NodeDelegateModel
.
There are several signals:
NodeDelegateModel::portsAboutToBeDeleted(...)
NodeDelegateModel::portsDeleted()
NodeDelegateModel::portsAboutToBeInserted(...)
NodeDelegateModel::portsInserted()
Alternatively, if you are not going to use the data propagation and aim an the simple graph visualization, you could derive your graph model from AbstractGraphModel
and emit the same signals from this class.
See the example "dynamic_ports".
Would it solve your problem?
The size and connections will be recalculated after the node data model update