nrabara
16th December 2009, 10:46
Hi,
How to know what's the file type in qt. I am using following method to know the file type.
QString fileName("/home/nirav/oneStar.jpg");
if(fileName.endsWith(".jpg",Qt::CaseSensitive);
qDebug()<< "File type is jpg" ;
else
qDebug()<< "File unknow" ;
But if image file only contains name(i.e oneStar), how to know that file is of Image type.
I have checked QDir,QFile,QFileinfo but no one provides file type, it can only differentiate File or Directory or System link.
can anybody suggest me the right way to find the file type.
You suggestion would be great help for me.
How to know what's the file type in qt. I am using following method to know the file type.
QString fileName("/home/nirav/oneStar.jpg");
if(fileName.endsWith(".jpg",Qt::CaseSensitive);
qDebug()<< "File type is jpg" ;
else
qDebug()<< "File unknow" ;
But if image file only contains name(i.e oneStar), how to know that file is of Image type.
I have checked QDir,QFile,QFileinfo but no one provides file type, it can only differentiate File or Directory or System link.
can anybody suggest me the right way to find the file type.
You suggestion would be great help for me.