PDA

View Full Version : QFile::handle count limits



evgenM
14th January 2010, 08:22
#include <QApplication>
#include <QFile>

int main( int argc, char ** argv )
{
QApplication app( argc, argv );
#ifdef Q_OS_WIN
QFile file("../src/main.cpp");
int i = 1;
while(1)
{
if (file.open(QIODevice::ReadOnly))
{
uchar* content = file.map(0, file.size());
if (file.handle() == -1)
break;

file.unmap(content);
++i;
}
else
{
printf("can't open file");
break;
}
file.close();
}

printf("handle count = %i\n", i);
#endif
return 0;
};


if call QFile::handle 2046 time, next time it always return "-1". It's problem only for windows.
Is my error or qt limit?