Dynamic Path QFile
I'm doing a function in which a program selects a picture from a file using a variable given by a String for example
QString name = "carlos" + ".png"; // (the first part of the string is given by a QLineEdit introduced by the user) QFile File("/home/pics/name")
Thanks in advance.
what is the question?
QString name = "carlos" + ".png";
QFile File("/home/pics/" + name");
QFile File( qApp->applicationDirPath() +"/"+ name");
to load it from folder where .exe is.
This is good for deployment time.
"/home/pics/" + name"
Indeed, it worked. Thank you :)