eg:
QFile f("/home/umanga/Desktop/image.jpg");
How I get only the filename - "image.jpg"?
eg:
QFile f("/home/umanga/Desktop/image.jpg");
How I get only the filename - "image.jpg"?
I use this:
bool utes::pathsplit(QString source,QString *path,QString *filename)
{
QString fn;
int index;
if (source == "") return(false);
fn = source.section("/", -1, -1);
if (fn == "") return(false);
index = source.indexOf(fn);
if (index == -1) return(false);
*path = source.mid(0,index);
*filename = fn;
return(true);
}