QDesktopServices can't open network drive path.
Unsolved
General and Desktop
-
Trying to open network drive path using QDesktopServices:
QString filePath = "//Camera20/data/"; QUrl url; if (filePath.startsWith("\\\\") || filePath.startsWith("//")) { url.setUrl(QDir::toNativeSeparators(filePath)); } else { url = QUrl::fromLocalFile(filePath); } QDesktopServices::openUrl(url);
But it returns an error: ShellExecute '%5C%5CCamera20%5Cdata%5C' failed (error 2).
What is wrong in my code?
win7, qt 5.9.4 -
@bronstein87
I'm either right or wrong on this, but is your network path as a url supposed to start withfile:
?