My application is using QDirIterator to iterate through .jpg images in a folder. The are named page0, page1, page2 ... page10, page 11... and so on.
The problem is that it is searching the files in the order page0, page1, page10, page11 and so on. How can i change this? Is there a option for ordering the files correctly?
Here is a small part of my code:
QDirIterator it(directory, QDirIterator::Subdirectories);
while (it.hasNext()) {
qDebug() << it.filePath();
if (it.filePath().contains(".jpg"))
{
string ImagePath = it.filePath().toStdString();
Mat img= cv::imread(ImagePath,3);
vectorMatchQuality.push_back(BestMatch(img, templ));
vectPath.push_back(ImagePath);
}
it.next();
}
I'm am new to C++ and Qt. Any help, tip or answer is appreciated :)