Qt5 escape spaces in path

There are two possible ways. You can either use escaped quotes (inserting the string between quotes) :

QStringList arguments;
QString str="\"/home/user/.wine/drive_c/users/user/Local Settings/LocalLow/A B C/test/test1\"";
arguments.append(str);

Or use the QStringList() overload of start which does the escaping automatically.

 

原文地址:https://stackoverflow.com/questions/27805585/qt5-escape-spaces-in-path

posted on 2019-01-23 16:41  liujx2019  阅读(227)  评论(0编辑  收藏  举报

导航