3 #include <QDesktopServices>
23 QUrl url(QStringLiteral(
"file://"));
28 tmp.replace(QChar(
'\\'), QChar(
'/'));
31 if (QFileInfo(path).isAbsolute()) {
32 tmp = QStringLiteral(
"/") + tmp;
34 url.setPath(tmp, QUrl::DecodedMode);
37 url.setPath(path, QUrl::DecodedMode);
39 return QDesktopServices::openUrl(url);
QT_UTILITIES_EXPORT bool openLocalFileOrDir(const QString &path)
Shows the specified file or directory using the default file browser.