Qt 6.6 have fixed the bug that each call of taking file's mtime performs slow OS' call. That results in very slow sorting by time.
So, opening of an image in a folder with thousands of images will faster hundreds times.
You only need to use QTimeZone::UTC in a sorting function.
Quite old but in qt6.6 QDateTime::lastModified() gained a new parameter 'QTimeZone' where you can pass QTimeZone::UTC to avoid conversion to the local time.
See also https://codereview.qt-project.org/c/qt/qtbase/+/437009
Qt 6.6 have fixed the bug that each call of taking file's mtime performs slow OS' call. That results in very slow sorting by time. So, opening of an image in a folder with thousands of images will faster hundreds times.
I wrote about it here: https://github.com/easymodo/qimgv/issues/290#issuecomment-1013809860
More info here: https://forum.qt.io/topic/133954/either-qfileinfo-caching-does-not-work-or-just-its-methods-are-unreasonable-very-slow https://bugreports.qt.io/browse/QTBUG-100349
https://www.qt.io/blog/qt-6.6-released
You only need to use
QTimeZone::UTC
in a sorting function.