Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. const FileName explorer = Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe"));
  2. if (explorer.isEmpty()) {
  3. QMessageBox::warning(parent,
  4. QApplication::translate("Core::Internal",
  5. "Launching Windows Explorer Failed"),
  6. QApplication::translate("Core::Internal",
  7. "Could not find explorer.exe in path to launch Windows Explorer."));
  8. return;
  9. }
  10. QStringList param;
  11. if (!fileInfo.isDir())
  12. param += QLatin1String("/select,");
  13. param += QDir::toNativeSeparators(fileInfo.canonicalFilePath());
  14. QProcess::startDetached(explorer.toString(), param);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement