qDebug() << QUrl::fromLocalFile("/tmp/te\\st/file.txt").toString(); // output is "file:///tmp/te/st/file.txt" // instead of "file:///tmp/te\st/file.txt" // or "file:///tmp/te%5Cst/file.txt"