1. static bool openUrl(const QUrl &url);
The openUrl() function is used to open files located at arbitrary URLs in external applications. For URLs that correspond to resources on the local filing system (where the URL scheme is “file”), a suitable application will be used to open the file; otherwise, a web browser will be used to fetch and display the file.
采用openUrl()函数,可以根据Url的类型,选择一个合适的应用程序(一般是采用默认应用程序)打开该url指向的文件;
static bool openUrl(const QUrl &url);
//QString fileName(qApp->applicationDirP

本文介绍了如何使用QDesktopServices的openUrl()函数根据URL类型智能地在本地文件系统或浏览器中打开文件,包括通过指定文件路径进行操作,并处理打开失败的情况。
最低0.47元/天 解锁文章
839

被折叠的 条评论
为什么被折叠?



