diff --git a/edge.cpp b/edge.cpp index 689d6f1..2ac4263 100644 --- a/edge.cpp +++ b/edge.cpp @@ -34,11 +34,9 @@ Node *Edge::destNode() const /// @note This is brute force. Isn't there a simple fv for this? QPointF firstNotContainedPoint(const QLineF &line, - const QPointF &pos, - const QRectF &rectangle, + const QRectF &rect, bool reverse = false) { - QRectF rect(rectangle.topLeft()+pos, rectangle.bottomRight()+pos); if (reverse) { for (qreal t = 1; t!=0; t-=0.01) @@ -72,14 +70,8 @@ void Edge::adjust() if (length > qreal(20.)) { - QPointF sourceOffset(firstNotContainedPoint(line, - m_sourceNode->pos(), - m_sourceNode->boundingRect() - )); - QPointF destOffset(firstNotContainedPoint(line, - m_destNode->pos(), - m_destNode->boundingRect() - ,true)); + QPointF sourceOffset(firstNotContainedPoint(line,m_sourceNode->sceneBoundingRect())); + QPointF destOffset(firstNotContainedPoint(line,m_destNode->sceneBoundingRect(),true)); m_sourcePoint = sourceOffset; m_destPoint = destOffset; diff --git a/node.cpp b/node.cpp index 54f92ad..b596a2d 100644 --- a/node.cpp +++ b/node.cpp @@ -35,6 +35,7 @@ QVariant Node::itemChange(GraphicsItemChange change, const QVariant &value) switch (change) { case ItemPositionHasChanged: +// if () foreach (Edge *edge, m_edgeList) edge->adjust(); break; diff --git a/systemtray.cpp b/systemtray.cpp index e50ed7f..bfd33c3 100644 --- a/systemtray.cpp +++ b/systemtray.cpp @@ -33,8 +33,6 @@ void SystemTray::setup() m_icon = new QIcon(":/heart.svg"); m_systemTrayIcon->setIcon(QIcon(":/heart.svg")); - - } SystemTray::SystemTray(MainWindow *mainWindow, QWidget *parent) : @@ -47,5 +45,7 @@ SystemTray::SystemTray(MainWindow *mainWindow, QWidget *parent) : void SystemTray::show() { + qDebug() << __PRETTY_FUNCTION__; + m_systemTrayIcon->show(); }