Results 1 to 7 of 7

Thread: QNetworkAccessManager downloadfile

  1. #1
    Join Date
    Mar 2010
    Posts
    34
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QNetworkAccessManager downloadfile

    Hi!

    I want to download files from the http using QNetworkAccesmanager, my ide is making a update functon for my program.

    But how can i code the downloader???

    Halvor.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QNetworkAccessManager downloadfile

    It's all in the docs. Isn't it? See detailed description of QNetworkAccessManager.

  3. #3
    Join Date
    Mar 2010
    Posts
    34
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QNetworkAccessManager downloadfile

    Yes, but i can understand it. Exemples please

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QNetworkAccessManager downloadfile

    Quote Originally Posted by halvors View Post
    Exemples please
    Then the Newbie section is more suitable for you and there is an example in the docs:
    Qt Code:
    1. QNetworkRequest request;
    2. request.setUrl(QUrl("http://qt.nokia.com"));
    3. request.setRawHeader("User-Agent", "MyOwnBrowser 1.0"); // not needed
    4.  
    5. QNetworkReply *reply = manager->get(request);
    6. connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
    7. connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
    8. this, SLOT(slotError(QNetworkReply::NetworkError)));
    9. connect(reply, SIGNAL(sslErrors(QList<QSslError>)),
    10. this, SLOT(slotSslErrors(QList<QSslError>)));
    To copy to clipboard, switch view to plain text mode 
    More is hardly possible, only the mention of QNetworkReply -> QIODevice::readAll().

  5. #5
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QNetworkAccessManager downloadfile

    Quote Originally Posted by Lykurg View Post
    Then the Newbie section is more suitable for you and there is an example in the docs:
    Qt Code:
    1. QNetworkRequest request;
    2. request.setUrl(QUrl("http://qt.nokia.com"));
    3. request.setRawHeader("User-Agent", "MyOwnBrowser 1.0"); // not needed
    4.  
    5. QNetworkReply *reply = manager->get(request);
    6. connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
    7. connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
    8. this, SLOT(slotError(QNetworkReply::NetworkError)));
    9. connect(reply, SIGNAL(sslErrors(QList<QSslError>)),
    10. this, SLOT(slotSslErrors(QList<QSslError>)));
    To copy to clipboard, switch view to plain text mode 
    More is hardly possible, only the mention of QNetworkReply -> QIODevice::readAll().

    i want use qhttp download part of an entry ,
    can you help me and edit my source http://www.mediafire.com/?dzjaztigrnm

    please read more:
    http://www.qtcentre.org/threads/3006...t-of-an-entity

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QNetworkAccessManager downloadfile

    nhs_0702, please don't do that. It's extremely rude and bad etiquette. You have you own thread and people will reply there.

  7. #7
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    1
    Qt products
    Qt4

    Default Re: QNetworkAccessManager downloadfile

    nice one!!!!

Similar Threads

  1. QNetworkAccessManager within QThread
    By Tomdarkness in forum Newbie
    Replies: 17
    Last Post: 26th August 2014, 15:12
  2. qnetworkaccessmanager problem!
    By novamaster in forum Qt Programming
    Replies: 6
    Last Post: 7th August 2010, 11:46
  3. Problems with QNetworkAccessManager
    By pfid in forum Qt Programming
    Replies: 1
    Last Post: 18th November 2009, 19:51
  4. QNetworkAccessManager or QHttp
    By mind_freak in forum Qt Programming
    Replies: 3
    Last Post: 29th September 2009, 20:24
  5. QNetworkAccessManager vs QHttp
    By jiveaxe in forum Newbie
    Replies: 3
    Last Post: 17th February 2009, 14:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.