The error message is self explanatory. You cannot copy a QFile (or any other QObject), and the copy constructor has been made private to enforce this. foreach() will be implicitly converting each string in your list to a QFile in a way that tries to invoke the copy constructor, e.g.
QFile foundFile = QString("test");
To copy to clipboard, switch view to plain text mode
Your loop needs to be:
foreach
(const QString &name, files
) { // operations...
}
foreach(const QString &name, files) {
QFile foundFile(name);
// operations...
}
To copy to clipboard, switch view to plain text mode
Bookmarks