Hi,

How to know what's the file type in qt. I am using following method to know the file type.
Qt Code:
  1. QString fileName("/home/nirav/oneStar.jpg");
  2.  
  3. if(fileName.endsWith(".jpg",Qt::CaseSensitive);
  4. qDebug()<< "File type is jpg" ;
  5. else
  6. qDebug()<< "File unknow" ;
To copy to clipboard, switch view to plain text mode 

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.