Important: Please read the Qt Code of Conduct -

QDesktopServices can't open network drive path.

  • Trying to open network drive path using QDesktopServices:

            QString filePath = "//Camera20/data/";
            QUrl url;
            if (filePath.startsWith("\\\\") || filePath.startsWith("//"))
                url = QUrl::fromLocalFile(filePath);

    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 with file:?

Log in to reply