From 1ee43b9b2414c0a2e476982e069f26bcd39b2544 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 16 Jan 2016 20:24:03 +0100 Subject: 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) --- src/widgets/graphicsview/qgraph_p.h | 5 +++-- 1 file 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 #include +#include // for std::less + #include 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()(from, to)) conns.append(qMakePair(from, to)); - } } return conns; } -- cgit v1.2.3