QDesktopServices::openUrl(中文路径)

系统:CutefishOS

QString s = "/home/sonichy/桌面/Spider-Man: No Way Home.jpg";
QDesktopServices::openUrl(s);

报错:xdg-open: file '/home/sonichy/%E6%A1%8C%E9%9D%A2/Spider-Man:%20No%20Way%20Home.jpg' does not exist

Qt QDesktopServices打开中文路径-CSDN论坛

改成:

QDesktopServices::openUrl(QUrl::fromLocalFile(s));

你可能感兴趣的:(Qt,Qt)