summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-04-22 04:48:09 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-04-22 04:48:09 (GMT)
commit1139eb432a18d556efb4ecfc079e82c2e2093b96 (patch)
tree57bbe6a7588ba01d88f0a9b9b28e4d95beadad1d /examples
parent2366667fc97eb6a56203b2dd7dac776ff4164abd (diff)
parentdb4e2a600c53ad857d7fa3f7d84ac995215ecf93 (diff)
downloadQt-1139eb432a18d556efb4ecfc079e82c2e2093b96.zip
Qt-1139eb432a18d556efb4ecfc079e82c2e2093b96.tar.gz
Qt-1139eb432a18d556efb4ecfc079e82c2e2093b96.tar.bz2
Merge branch 'master' of ../../qt/qt into kinetic-declarativeui
Diffstat (limited to 'examples')
-rw-r--r--examples/examples.pro2
-rw-r--r--examples/graphicsview/elasticnodes/edge.cpp11
2 files changed, 9 insertions, 4 deletions
diff --git a/examples/examples.pro b/examples/examples.pro
index 874cd37..4677a23 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -36,7 +36,7 @@ embedded:SUBDIRS += qws
}
contains(QT_CONFIG, opengl): SUBDIRS += opengl
contains(QT_CONFIG, dbus): SUBDIRS += dbus
-win32:!contains(QT_EDITION, OpenSource|Console):SUBDIRS += activeqt
+win32: SUBDIRS += activeqt
contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns
contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= mainwindows
diff --git a/examples/graphicsview/elasticnodes/edge.cpp b/examples/graphicsview/elasticnodes/edge.cpp
index 4018c25..e32a35a 100644
--- a/examples/graphicsview/elasticnodes/edge.cpp
+++ b/examples/graphicsview/elasticnodes/edge.cpp
@@ -93,11 +93,16 @@ void Edge::adjust()
QLineF line(mapFromItem(source, 0, 0), mapFromItem(dest, 0, 0));
qreal length = line.length();
- QPointF edgeOffset((line.dx() * 10) / length, (line.dy() * 10) / length);
prepareGeometryChange();
- sourcePoint = line.p1() + edgeOffset;
- destPoint = line.p2() - edgeOffset;
+
+ if (!qFuzzyCompare(length, qreal(0.0))) {
+ QPointF edgeOffset((line.dx() * 10) / length, (line.dy() * 10) / length);
+ sourcePoint = line.p1() + edgeOffset;
+ destPoint = line.p2() - edgeOffset;
+ } else {
+ sourcePoint = destPoint = line.p1();
+ }
}
QRectF Edge::boundingRect() const