最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

QT 通过一个http链接 打开一个浏览器和对应的网页

运维笔记admin1浏览0评论

如果是QT5 以下版本使用:

#include <QtCore/QUrl>
#include <QtGui/QDesktopServices>

void LoginDialog::on_testButton_clicked()

{
const QUrl regUrl(QLatin1String("http://www.baidu"));
QDesktopServices::openUrl(regUrl);

}


如果是QT5 以上版本使用:

#include <QUrl>
#include <QDesktopServices>

void LoginDialog::on_testButton_clicked()

{
const QUrl regUrl(QLatin1String("http://www.baidu"));
QDesktopServices::openUrl(regUrl);

}


发布评论

评论列表(0)

  1. 暂无评论