使用QDesktopServices打开资源文件

    xiaoxiao2023-11-24  174

    使用QDesktopServices打开文件目录或网络连接。

    打开本地文件或目录

    方式1 QDesktopServices::openUrl(QUrl::fromLocalFile("C:\\Users\\User\\Documents")); 方式2 QDesktopServices::openUrl(QUrl::fromLocalFile("C:/Users/User/Documents")); 方式3 QDesktopServices::openUrl(QUrl::fromLocalFile("file:///C:/Users/User/Documents"));

    打开网址

    QDesktopServices::openUrl(QUrl("http://www.qtbig.com/about/"));
    最新回复(0)