坚持QtQML,坚持移动互联网

http://www.qtcn.org/bbs/u/121778  [收藏] [复制]

toby520

将QtCoding进行到底,做Qt的宠儿

  • 89

    关注

  • 164

    粉丝

  • 3579

    访客

  • 等级:精灵王
  • 身份:论坛版主
  • 总积分:1262
  • 男,1986-11-17

最后登录:2024-04-30

更多资料

日志

Qt5.x以上使用QHttp功能

2013-05-24 10:17
一、需求:
最近要将Qt4.x项目移植到Qt5.x上,遇到移植的问题不少,最头疼的事情就是以前项目不小心使用了QHttp这个类,虽然4.7.x以后不建议使用QHttp:
Detailed Description
The QHttp class provides an implementation of the HTTP protocol.
This class provides a direct interface to HTTP that allows you to download and upload data with the HTTP protocol. However, for new applications, it is recommended to use QNetworkAccessManager and QNetworkReply, as those classes possess a simpler, yet more powerful API and a more modern protocol implementation.
this class is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
二、方案:
The QFtp, QUrlInfo, QHttp classes are not public anymore. Use QNetworkAccessManager instead to avoid binary breaks in the future. Programs that require raw FTP/HTTP streams, can use the compatibility add-ons QtFtp and QtHttp which provides the QFtp and QHttp classes as they existed in Qt 4.所以我们需要下载Qthttp源码链接
1.使用qmake进行编译,然后make后在make install,和编译qt源码类似,把qhttp模块安装到相应的地方后在pro里面 QT += http
2.使用qthttp源码,加入到项目中和项目其他代码一起进行编译,这个方法我测试过在qt5.1beta版本没有问题。
BTW:若是使用qftp流程应该也差不多
分类:Qt|回复:0|浏览:3467|全站可见|转载
 

Powered by phpwind v8.7 Certificate Copyright Time now is:05-01 19:26
©2005-2016 QTCN开发网 版权所有 Gzip disabled