PDA

View Full Version : qt 4.8.1 and qdir entryInfoList problem



moti.lahiani
17th April 2012, 07: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
Moti

Spitfire
17th April 2012, 15: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();
}
}


Output:


"C:/PerfLogs"
"C:/Program Files"
"C:/Program Files (x86)"
"C:/QtSDK"
"C:/Users"
"C:/Windows"

moti.lahiani
18th April 2012, 06: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?

Spitfire
18th April 2012, 11: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?