首页 > 其他 > 详细

Qt 桌面服务 QDesktopServices

时间:2021-08-25 08:21:35      阅读:19      评论:0      收藏:0      [点我收藏+]

 

使用浏览器打开网址

#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));

 

Qt 桌面服务 QDesktopServices

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!