呵呵,找到解决方法了,用转义字符。
分两步:
1.cd进入一个带有空格的目录时(如目录a b),需在目录名上加入双引号:cd "a b"
2.QString tmp = "a b";
QString tmpPath= "cp" + "/usb/ \"" + tmp + "\" /home";
char command[1024];
memset(command, 0, 1024);
strcpy(command, tmpPath.toUtf8().data());
printf("fileName is %s\n", command);
system(command);
system("sync");