How to sort QList of QDateTime * objects by value of QDateTime object?
You can use qSort your own comparison function:
qSort
#include <QtAlgorithms> bool dtcomp(QDateTime* left, QDateTime *right) { return *left < *right; } QList<DateTime*> dtlist = ...; qSort(dtlist.begin(), dtlist.end(), dtcomp);