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:
parent
ce9dc06b4c
commit
0208cac94f
@ -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());
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user