nodeview: allow users to place a node on an edge to automatically connect it

between the two nodes

UI convenience. Edge highlights when the cursor is in range to perform this
action.
This commit is contained in:
itsmattkc
2020-02-16 12:40:12 +11:00
parent a987899e5c
commit ce889f68d5
6 changed files with 111 additions and 8 deletions
+10
View File
@@ -68,6 +68,13 @@ public:
*/
void SetConnected(bool c);
/**
* @brief Set highlighted state
*
* Changes color of edge.
*/
void SetHighlighted(bool e);
protected:
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
@@ -77,6 +84,9 @@ private:
int edge_width_;
bool connected_;
bool highlighted_;
};
#endif // NODEEDGEITEM_H