Results 1 to 6 of 6

Thread: Fill input in QWebView

  1. #1
    Join Date
    Dec 2010
    Location
    Tarnów, Poland/Polska
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Fill input in QWebView

    Hello
    I'm forgein so my english isn't so good, but i think that you understand me.

    I have a few problems with filling some inputs. Usually when I change value of input and I send it, it works that same as I fill it normally. But on the hotmail.com or imageshack.us (when I change to url) while I want to change value nothing happens after click submit button.

    How can I do this? What I should use to fill those inputs?

  2. #2
    Join Date
    Dec 2010
    Location
    Tarnów, Poland/Polska
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Fill input in QWebView

    Please, help me

  3. #3
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Fill input in QWebView

    You're asking what to use to fill the inputs and at the same time you wrote
    Usually when I change value of input and I send it,
    What are you using now to change the value of input, then? Can you show some code?

  4. #4
    Join Date
    Dec 2010
    Location
    Tarnów, Poland/Polska
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Fill input in QWebView

    I mean, that when I change value usually it works. I don't use other way. I ask you about another way to fill all, not part of inputs.

    I know that it's possible to do it in Qt, because I saw one program in Qt which can do it ;]

  5. #5
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Fill input in QWebView

    Quote Originally Posted by RzuF View Post
    I ask you about another way to fill all, not part of inputs.
    I don't understand above statement.
    Can you show the code you're using now to set value of input fields and submit a form?

  6. #6
    Join Date
    Dec 2010
    Location
    Tarnów, Poland/Polska
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Fill input in QWebView

    Qt Code:
    1. doc = ui->webView->page()->mainFrame()->documentElement();
    2.  
    3. QWebElement login = doc.findFirst("input[id=\"login\"]");
    4. QWebElement password = doc.findFirst("input[id=\"password\"]");
    5. QWebElement password_conf = doc.findFirst("input[id=\"password_conf\"]");
    6. QWebElement answer = doc.findFirst("input[id=\"secret_a\"]");
    7. QWebElement recapatcha = doc.findFirst("input[id=\"recaptcha_response_field\"]");
    8.  
    9. login.setAttribute("value", ui->lineEdit->text());
    10. password.setAttribute("value", ui->lineEdit_2->text());
    11. password_conf.setAttribute("value", ui->lineEdit_2->text());
    12. answer.setAttribute("value", ui->lineEdit_3->text());
    13. recapatcha.setAttribute("value", ui->lineEdit_4->text());
    To copy to clipboard, switch view to plain text mode 

    I only fill inputs and I sumbit it by myself in QWebView. It hard to me, explain this what I want to do. But I belive you will understand me ;]

    EDIT:

    I think that I should use Requests to do it, am I on good way?
    Last edited by RzuF; 19th December 2010 at 12:33.

Similar Threads

  1. Replies: 8
    Last Post: 3rd September 2013, 09:51
  2. Socket buffer fill
    By navi1084 in forum Qt Programming
    Replies: 3
    Last Post: 31st August 2009, 12:25
  3. Fill mode using QPainter
    By lni in forum Qt Programming
    Replies: 7
    Last Post: 23rd March 2009, 18:03
  4. How to fill the grid with the color?
    By merry in forum Qt Programming
    Replies: 3
    Last Post: 18th June 2007, 11:10
  5. How to fill the blocks of the Grid one by one?
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 6th June 2007, 12:20

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.