summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-16 20:24:03 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-01-17 13:23:01 +0000
commit1ee43b9b2414c0a2e476982e069f26bcd39b2544 (patch)
treee622d2ab7d8552a4444db6b07300ea310aa8945e /src
parentf48f8ba0bb7d2b3b4c1210ca4c7a3b23108c2f5a (diff)
QGraphicsView: Graph: don't compare pointers with op<
It's undefined behavior. Use std::less, which has defined behavior. Change-Id: I990d197590cf535c1cb5c055d0b6798e602446dc Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/graphicsview/qgraph_p.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/graphicsview/qgraph_p.h b/src/widgets/graphicsview/qgraph_p.h
index 1314f6ab36..53701764de 100644
--- a/src/widgets/graphicsview/qgraph_p.h
+++ b/src/widgets/graphicsview/qgraph_p.h
@@ -56,6 +56,8 @@
#include <QtCore/QString>
#include <QtCore/QDebug>
+#include <functional> // for std::less
+
#include <float.h>
QT_BEGIN_NAMESPACE
@@ -213,9 +215,8 @@ public:
Vertex *from = it.from();
Vertex *to = it.to();
// do not return (from,to) *and* (to,from)
- if (from < to) {
+ if (std::less<Vertex*>()(from, to))
conns.append(qMakePair(from, to));
- }
}
return conns;
}