程序代码:
QString file="/home/user/Desktop/a.svg";
if(!QDesktopServices::openUrl(QUrl::fromLocalFile(file)))//根据您的建议修改过,可以打开含空格文件
{
QMessageBox::information(this,"file can not be open",file,QMessageBox::OK);
}
控制台信息
Error showing url: There is no default action associated with this location.
问题:
已经安装过应用软件,而且svg文件可以打开,但是这里打不开,而且openurl()仍然返回true
提示对话框不会显示,如何判断是否成功打开,不成功则弹出对话框呢?