View Full Version : qt 4.8.1 and qdir entryInfoList problem

17th April 2012, 08:06
Hello all

I,m working with the QTSDK 1.2.1 and use the QT 4.8.1 on visual studio 2010
my OS is Win7
the problem is if i try the following code:

QDir pathInfo("C:\");
QFileInfoList childrenInfo = pathInfo.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks );

i get an empty list. if instead i call to pathInfo.entryInfoList() i get all the folders but i must have the filers.

before i upgrade to 4.8.1 i worked with QTSDK 1.1 ( i think) using the QT 4.7.4 and its work fine

is any one know if its a known bugs? how can i pass it?
or is any one has a solution for that?

thanks a lot

17th April 2012, 16:44
W7 64bit & Qt 4.8.1 (mingw) works fine for me.

int main(int argc, char *argv[])
QDir d( "C:/" );

QFileInfoList fl = d.entryInfoList( QDir::AllDirs | QDir::NoDotAndDotDot | QDir::NoSymLinks );

for( int i = 0; i < fl.size(); ++i )
qDebug() << fl.at( i ).absoluteFilePath();


"C:/Program Files"
"C:/Program Files (x86)"

18th April 2012, 07:24
Thanks for your time
this works for me too when i run it in QtCreator (mingw)
but when i test it with vs2010 it doesnt work for me
although the same code works with vs2008 and qt 4.7.4

Do you know if there is a different between those two versions?
or if the problem is with my vs envarioment?

18th April 2012, 12:56
It may be that new vs is using different compiler and that causes some wieird binary incompatibility issue, but I don't know much more, I haven't used msvs in a long time now.

Maybe someone with msvs could shine some light on this?