Skip to content

Instantly share code, notes, and snippets.

@benjbaron
Created July 16, 2015 17:06
Show Gist options
  • Save benjbaron/0b29aadf4f0c4d8e13ee to your computer and use it in GitHub Desktop.
Save benjbaron/0b29aadf4f0c4d8e13ee to your computer and use it in GitHub Desktop.
Qt check whether there is a file with the given extensions
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