Solved Get the name of file with path Qt
-
Hi i have one file like
C:/Myuser/thefile.txtHow i can get the name of this file???
-
@Jeronimo
see QFileInfo class
Please use the search before posting. -
Hi,
Use the class QFileInfo
Sample Code:
QFileInfo fi("C:/Myuser/thefile.txt");
QString name = fi.fileName();Here is the below link for more information regarding the QFileInfo Class and to get filename.
http://doc.qt.io/qt-4.8/qfileinfo.html#fileName
Thanks,