Results 1 to 6 of 6

Thread: Posting data to QWebView

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    31
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Posting data to QWebView

    Hi

    How can I post data to QWebView

  2. #2
    Join Date
    Oct 2009
    Posts
    31
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Posting data to QWebView

    or is it even possible?
    or can I enter data in a form in an existing widget?

    Basically I'm trying to automatically log into a website

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Posting data to QWebView

    What do you mean "post data to QWebView"? What data? QWebView is just a widget that displays a web page. If you want to log onto the site, you have to post the data to the server and not your local widget.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Oct 2009
    Posts
    31
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Posting data to QWebView

    What I mean is controlling the widget to make it post the login information, as if someone is manually entering the data, if thats possible...
    I've tried reading the source code for the login webpage and posting the keys and values that are in the form to the server and displaying the result in the widget. I can display the html data I get back from the server, how do I get the url that the server replies with

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Posting data to QWebView

    QWebView::load() with your own network request as the argument.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    chrisb123 (29th October 2009)

  7. #6
    Join Date
    Oct 2009
    Posts
    31
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Posting data to QWebView

    awesome it works as expected
    Qt Code:
    1. QUrl iws("https://secure.website");
    2. QByteArray iws2;
    3. iws2.append("username=" + user2.toAscii());
    4. iws2.append("&password=" + pass2.toAscii());
    5. load(QNetworkRequest(iws),QNetworkAccessManager::PostOperation,iws2);
    To copy to clipboard, switch view to plain text mode 

  8. The following user says thank you to chrisb123 for this useful post:

    msimurin (30th April 2010)

Similar Threads

  1. data rate transfer is decreasing in TCP connection
    By navi1084 in forum Qt Programming
    Replies: 3
    Last Post: 19th June 2009, 16:15
  2. Best way to display lots of data fast
    By New2QT in forum Newbie
    Replies: 4
    Last Post: 16th October 2008, 22:46
  3. Replies: 7
    Last Post: 29th August 2008, 10:24
  4. Replies: 4
    Last Post: 19th October 2007, 19:47
  5. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 12:53

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.