#include <QDesktopServices>
QDesktopServices::openUrl(QUrl(urlPath, QUrl::TolerantMode));
说明:
(1)地址前缀:必须添加 file:/// 路径符;
(2)远程路径:必须是完整的路径,不能是动态拼接的。
(3)网址:不需要路径符;
(4)文件:会选择系统默认的应用打开。
#include <QDesktopServices>
QDesktopServices::openUrl(QUrl(urlPath, QUrl::TolerantMode));
说明:
(1)地址前缀:必须添加 file:/// 路径符;
(2)远程路径:必须是完整的路径,不能是动态拼接的。
(3)网址:不需要路径符;
(4)文件:会选择系统默认的应用打开。