Created
July 16, 2015 17:06
-
-
Save benjbaron/0b29aadf4f0c4d8e13ee to your computer and use it in GitHub Desktop.
Qt check whether there is a file with the given extensions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QString checkFile(QString foldername, QStringList exts, QString filename) { | |
foreach(auto ext, exts) { | |
QFileInfo check(foldername+"/"+filename+"."+ext); | |
if(check.exists() && check.isFile()) | |
return check.absoluteFilePath(); | |
return QString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment