Qt 桌面服务 QDesktopServices

时间:2021-08-25 08:21:35   收藏:0   阅读:18

 

使用浏览器打开网址

#include <QDesktopServices>
#include <QUrl>

QUrl url(QString("https://cn.bing.com"));
QDesktopServices::openUrl(url);

 

 

打开本地文件夹

#include <QDesktopServices>
#include <QUrl>

QString filePath = QString("D:");
QString path = QString("file:///") + filePath;
QDesktopServices::openUrl(QUrl(path, QUrl::TolerantMode));

 

原文:https://www.cnblogs.com/shiyixirui/p/15182748.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!