1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/examples/qqthttpdownload/qqthttpdownloadmanager.cpp

20 lines
613 B
C++
Raw Normal View History

2017-11-23 12:33:32 +08:00
#include "qqthttpdownloadmanager.h"
QQtHttpDownloadManager::QQtHttpDownloadManager ( QObject* parent ) : QQtWebAccessManager ( parent )
{
2017-11-23 19:12:48 +08:00
QFile file ( "/Users/abel/Develop/c2-test/aa" );
file.open ( QFile::Truncate | QFile::WriteOnly );
file.close();
}
2017-11-23 12:33:32 +08:00
2017-11-23 19:12:48 +08:00
void QQtHttpDownloadManager::replyReadyRead ( QQtWebAccessSession* session )
{
pline() << session->getWebAccessReply()->url();
QByteArray data = session->getWebAccessReply()->readAll();
pline() << data;
QFile file ( "/Users/abel/Develop/c2-test/aa" );
file.open ( QFile::Append );
file.write ( data );
file.close();
2017-11-23 12:33:32 +08:00
}