Results 1 to 2 of 2

Thread: How to get http reply to var, for example: to ui->textBrowser?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2012
    Posts
    16
    Qt products
    Qt4

    Default How to get http reply to var, for example: to ui->textBrowser?

    QNetworkRequest request;
    networkManager = new QNetworkAccessManager(this);
    request.setUrl(QUrl("http://qt.nokia.com"));
    request.setRawHeader("User-Agent", "MyOwnBrowser 1.0");
    networkManager->get(request);
    How to get reply to var, for example: to ui->textBrowser?
    Last edited by lapdx; 6th November 2012 at 18:01.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to get http reply to var, for example: to ui->textBrowser?

    Well, you start by not discarding the QNetworkReply returned by QNetworkAccessManager::get(), connect something to its signals, and get on with life while you wait for the response to come back. When you get the response, check it is not an error, extract the content by reading the QIODevice, and put it in your widget. There is more than one example in the docs and this forum.

Similar Threads

  1. how to scroll a textbrowser ?
    By kumari arpita in forum Newbie
    Replies: 2
    Last Post: 10th August 2012, 08:56
  2. Replies: 0
    Last Post: 7th August 2012, 19:36
  3. Time in textBrowser
    By NewLegend in forum Qt Programming
    Replies: 13
    Last Post: 12th October 2010, 04:37
  4. New Line in textBrowser
    By NewLegend in forum Qt Programming
    Replies: 4
    Last Post: 12th August 2010, 05:29

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
  •  
Qt is a trademark of The Qt Company.