eg:
QFile f("/home/umanga/Desktop/image.jpg");
How I get only the filename - "image.jpg"?
Use a QFileInfo to strip out the path (if any):
QFileInfo
QFileInfo fileInfo(f.fileName()); QString filename(fileInfo.fileName());