My goal is to see how many lines in each file (.h and .cpp). I can only see the files in the current directory, sorted by size for now. I need to set path by using QString. Then, maybe QDir and QFiles can be useful. Thanks for your precious time.
QDir dir;
dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
dir.setSorting(QDir::Size | QDir::Reversed);
QFileInfoList list = dir.entryInfoList();
qInfo() << " Bytes Filename" << Qt::endl;
for(int i=0; i<list.size(); i++)
{
QFileInfo fileInfo = list.at(i);
std::cout << qPrintable(QString("%1 %2").arg(fileInfo.size(), 10)
.arg(fileInfo.fileName()));
std::cout << std::endl;
}