It’s a demonstration only image viewer made with Qt6. The binaries are available.

QtConcurrent::run.QFileInfo in std::sort, but a custom struct.GetLongPathNameW). An 8.3 can be faced on a user input of a file with long path (260+ chars) from disc C from Windows Explorer:
on Drag’n’Drop and when a user opens an image with a double click (the image path is passed as a command line argument to the program.)\\?\ (\\?\UNC\).QDir::Hidden).qDebug().Here is the example of the console log, after the program is started (~70 ms):
The speed results for 350 KB image with a directory with 30000+ files (Run it with Qt Creator to look at the qDebug() logs):
At this moment the image is visible.
That is performed in a background thread:
Note: Do NOT use code that calls methods of QFileInfo in std::sort. It’s incredibly slow.
That is up to 600 times slower
std::sort(fileEntryList.begin(), fileEntryList.end(),
[](const FileEntry& a, const FileEntry& b) {
return a.fileInfo.lastModified() < b.fileInfo.lastModified();
}
);
than that
std::sort(fileEntryList.begin(), fileEntryList.end(),
[](const FileEntry& a, const FileEntry& b) {
return a.mtime < b.mtime;
}
);
3200-3600 ms vs 6 ms.
So, store all required fields of QFileInfo in your own data struct.
Try by yourself (uncomment the line 307 and comment lines 298-304): https://github.com/AlttiRi/demo-image-viewer/blob/ad9ac9b1c9d78244462064983e676542700e96d9/core.h#L296-L311
demo-imgv.exe file. Use release build../build/Desktop_Qt_6_10_0_MinGW_64_bit-Release/release)*.o, *.cpp, *.h) except demo-imgv.exe file.demo-imgv.exe file from the File Explorer on windeployqt6 (C:\Qt\6.10.0\mingw_64\bin\windeployqt6.exe) to create all reuired files (DLLs and others) for the demo-imgv.exe file.demo-imgv.exeQt6Core.dllQt6Gui.dllQt6Widgets.dlllibgcc_s_seh-1.dlllibstdc++-6.dlllibwinpthread-1.dllimageformats/* (qgif.dll, qico.dll, qjpeg.dll, qsvg.dll)platforms/qwindows.dllstyles/qmodernwindowsstyle.dll (optionally)(So, remove: D3Dcompiler_47.dll, Qt6Network.dll, Qt6Svg.dll, opengl32sw.dll, generic/, iconengines/, networkinformation/, tls/, translations/)