Details
-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
5.15.2
-
None
Description
When I use QProcess::startDetached to open the file explorer and select the file, I don't have any problem if I use the following.
Func A:
QProcess::startDetached("explorer /select," + file_path);
But when I switch to using the
Func B: QProcess::startDetached("explorer", QStringList() << "/select," + file_path);
if there are spaces in the middle of the file name, the func B will automatically generate a command with quotation marks like explorer “/select,D:\view vast.jpg” but func A is explorer /select,D:\view vast.jpg without quotes. Func B incorrectly adds unnecessary quotes causing this command to not work properly, whereas unnecessary quotes are only added if there are spaces in file_path. But Func A is QT_DEPRECATED.
use setNativeArguments() and the non-static startDetached() variant didn't work either