nodeview: associate disconnected nodes with selected blocks until re-connected

This commit is contained in:
itsmattkc
2020-05-13 16:06:13 +10:00
parent ce58671fd6
commit 1ed0814e83
5 changed files with 150 additions and 249 deletions
+13 -9
View File
@@ -102,6 +102,9 @@ private:
void UpdateBlockFilter();
void AssociateNodeWithSelectedBlocks(Node* n);
void DisassociateNode(Node* n, bool remove_from_map);
NodeGraph* graph_;
struct AttachedItem {
@@ -118,6 +121,10 @@ private:
QList<Block*> selected_blocks_;
QHash<Node*, QList<Block*> > association_map_;
QHash<Block*, QList<Node*> > temporary_association_map_;
enum FilterMode {
kFilterShowAll,
kFilterShowSelectedBlocks
@@ -126,12 +133,14 @@ private:
FilterMode filter_mode_;
private slots:
void AddNodes(const QList<Node*> node);
void AddNode(Node* node);
void AddEdge(NodeEdgePtr edge);
void ValidateFilter();
void AssociatedNodeDestroyed();
void GraphEdgeAdded(NodeEdgePtr edge);
void GraphEdgeRemoved(NodeEdgePtr edge);
/**
* @brief Internal function triggered when any change is signalled from the QGraphicsScene
*
@@ -169,11 +178,6 @@ private slots:
*/
void ContextMenuLabelNode();
/**
* @brief Receiver that shows the filters dialog
*/
void ContextMenuShowFiltersDialog();
/**
* @brief Receiver for the user changing the filter
*/