• 4375阅读
  • 4回复

怎么在QT中编程实现打开一个网页? [复制链接]

上一主题 下一主题
离线foxgod
 

只看楼主 倒序阅读 楼主  发表于: 2011-09-19
我想在QT中实现,打开一个网页,如何可以的话,能否控制我本地的浏览器打开这个网页呢,谢谢
看到网上有这样写的,QDesktopServies::openUrl(QUrl(http://www.xxxx.com/ssss));可是我这样写,就没打开呀。

离线langzi

只看该作者 1楼 发表于: 2011-09-23
没有研究过,学习!
离线chemmyhuang
只看该作者 2楼 发表于: 2011-09-28
qwebview
离线sdwf
只看该作者 3楼 发表于: 2011-09-28
#include <QDesktopServices>


在pro文件中QT       +=   network  
离线xuweistudy
只看该作者 4楼 发表于: 2011-09-28
助手文档里有这么一段:
Opens the given url in the appropriate Web browser for the user's desktop environment, and returns true if successful; otherwise returns false.
If the URL is a reference to a local file (i.e., the URL scheme is "file") then it will be opened with a suitable application instead of a Web browser.
The following example opens a file on the Windows file system residing on a path that contains spaces:
QDesktopServices::openUrl(QUrl("file:///C:/Documents and Settings/All Users/Desktop", QUrl::TolerantMode));

QUrl::QUrl ( const QString & url, ParsingMode parsingMode )参数传对了吗?
快速回复
限100 字节
 
上一个 下一个