Sort filenames naturally with Qt
If you want to use QCollator to sort entries from the list of entries returned by QDir::entryList, you can sort the result with std::sort(): dir.setFilter(QDir::Files | QDir::NoSymLinks); dir.setSorting(QDir::NoSort); // will sort manually with std::sort auto entryList = dir.entryList(); QCollator collator; collator.setNumericMode(true); std::sort( entryList.begin(), entryList.end(), [&](const QString &file1, const QString &file2) { return collator.compare(file1, file2) < … Read more