首页 > 技术文章 > Qt5 escape spaces in path

liujx2019 2019-01-23 16:41 原文

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

推荐阅读