QItemSelectionRange: don't compare pointers with op<

... use std::less<> to avoid undefined behavior.

Change-Id: Ib6736f86359c4a16fd90ca63b57a8517c6137ead
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Marc Mutz 2015-07-20 01:10:53 +02:00
parent ce9dc06b4c
commit 0208cac94f

View File

@ -42,6 +42,7 @@
#include <qdebug.h>
#include <algorithm>
#include <functional>
#ifndef QT_NO_ITEMVIEWS
@ -307,7 +308,9 @@ bool QItemSelectionRange::operator<(const QItemSelectionRange &other) const
}
return topLeftParent < otherTopLeftParent;
}
return tl.model() < other.tl.model();
std::less<const QAbstractItemModel *> less;
return less(tl.model(), other.tl.model());
}
/*!