Dynamic Path QFile
Solved
General and Desktop
-
Hi!
I'm doing a function in which a program selects a picture from a file using a variable given by a String for exampleQString 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");or
QFile File( qApp->applicationDirPath() +"/"+ name");
to load it from folder where .exe is.
This is good for deployment time.