there is a function called sceneBoundingRect...

master
Denes Matetelki 14 years ago
parent 68422f166b
commit da0ebc6180

@ -34,11 +34,9 @@ Node *Edge::destNode() const
/// @note This is brute force. Isn't there a simple fv for this? /// @note This is brute force. Isn't there a simple fv for this?
QPointF firstNotContainedPoint(const QLineF &line, QPointF firstNotContainedPoint(const QLineF &line,
const QPointF &pos, const QRectF &rect,
const QRectF &rectangle,
bool reverse = false) bool reverse = false)
{ {
QRectF rect(rectangle.topLeft()+pos, rectangle.bottomRight()+pos);
if (reverse) if (reverse)
{ {
for (qreal t = 1; t!=0; t-=0.01) for (qreal t = 1; t!=0; t-=0.01)
@ -72,14 +70,8 @@ void Edge::adjust()
if (length > qreal(20.)) { if (length > qreal(20.)) {
QPointF sourceOffset(firstNotContainedPoint(line, QPointF sourceOffset(firstNotContainedPoint(line,m_sourceNode->sceneBoundingRect()));
m_sourceNode->pos(), QPointF destOffset(firstNotContainedPoint(line,m_destNode->sceneBoundingRect(),true));
m_sourceNode->boundingRect()
));
QPointF destOffset(firstNotContainedPoint(line,
m_destNode->pos(),
m_destNode->boundingRect()
,true));
m_sourcePoint = sourceOffset; m_sourcePoint = sourceOffset;
m_destPoint = destOffset; m_destPoint = destOffset;

@ -35,6 +35,7 @@ QVariant Node::itemChange(GraphicsItemChange change, const QVariant &value)
switch (change) { switch (change) {
case ItemPositionHasChanged: case ItemPositionHasChanged:
// if ()
foreach (Edge *edge, m_edgeList) edge->adjust(); foreach (Edge *edge, m_edgeList) edge->adjust();
break; break;

@ -33,8 +33,6 @@ void SystemTray::setup()
m_icon = new QIcon(":/heart.svg"); m_icon = new QIcon(":/heart.svg");
m_systemTrayIcon->setIcon(QIcon(":/heart.svg")); m_systemTrayIcon->setIcon(QIcon(":/heart.svg"));
} }
SystemTray::SystemTray(MainWindow *mainWindow, QWidget *parent) : SystemTray::SystemTray(MainWindow *mainWindow, QWidget *parent) :
@ -47,5 +45,7 @@ SystemTray::SystemTray(MainWindow *mainWindow, QWidget *parent) :
void SystemTray::show() void SystemTray::show()
{ {
qDebug() << __PRETTY_FUNCTION__;
m_systemTrayIcon->show(); m_systemTrayIcon->show();
} }

Loading…
Cancel
Save