我正在使用 VS2019,Qt 5.15.2
我在以下目录entryList
中使用类的方法:QDir
entryList
带有参数的方法的以下行为QDir::NoDotAndDotDot
很奇怪:
tTe 以下示例不言自明:我的代码:
LOG( INFO ) << "entryList with no parameter";
foreach( auto elementName, p_dir.entryList() )
{
LOG( INFO ) << "elementName : " << elementName.toStdString();
}
LOG( INFO ) << "entryList with QDir::NoDotAndDotDot";
foreach( auto elementName, p_dir.entryList( QDir::NoDotAndDotDot ) )
{
LOG( INFO ) << "elementName : " << elementName.toStdString();
}
输出如下:
2021-04-01-10:29:33,482724 | INFO | entryList with no parameter | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:58
2021-04-01-10:29:33,482773 | INFO | elementName : . | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,482805 | INFO | elementName : .. | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,482844 | INFO | elementName : ABDOMEN | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,482876 | INFO | elementName : CHEST | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,482913 | INFO | elementName : CSPINE | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,482944 | INFO | elementName : ELBOW | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,482985 | INFO | elementName : FOOT | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,483019 | INFO | elementName : HAND | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,483053 | INFO | elementName : KNEE | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,483090 | INFO | elementName : LSPINE | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,483123 | INFO | elementName : PELVIS | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,483155 | INFO | elementName : RIB | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,483186 | INFO | elementName : SHOULDER | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,483221 | INFO | elementName : SKULL | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,483252 | INFO | elementName : TSPINE | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:61
2021-04-01-10:29:33,483284 | INFO | entryList with QDir::NoDotAndDotDot | xxxxxxxxx.cpp->RecursiveProcessingFilesFinder:64
我不明白为什么,如果我使用过滤器QDir::NoDotAndDotDot
,entryList 输出现在是空的???