nodeview: update positions correctly

This commit is contained in:
itsmattkc
2021-05-24 10:12:53 +10:00
parent 74a1507c6f
commit f9309da4b3
6 changed files with 149 additions and 83 deletions
+7 -1
View File
@@ -40,8 +40,9 @@ class NodeViewEdge;
*
* To retrieve the NodeViewItem for a certain Node, use NodeView::NodeToUIObject().
*/
class NodeViewItem : public QGraphicsRectItem
class NodeViewItem : public QObject, public QGraphicsRectItem
{
Q_OBJECT
public:
NodeViewItem(QGraphicsItem* parent = nullptr);
@@ -111,6 +112,9 @@ public:
void SetHighlightedIndex(int index);
signals:
void NodePositionChanged(const QPointF &pos);
protected:
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
@@ -174,6 +178,8 @@ private:
QPointF cached_node_pos_;
bool dont_signal_;
};
}