Results 1 to 5 of 5

Thread: How to activate form buttons in a QWebPage

  1. #1
    Join Date
    Apr 2009
    Posts
    12

    Default How to activate form buttons in a QWebPage

    I've loaded a webpage in QT using a QWebPage object and its mainFrame()->load() function. On this webpage there's a form with two buttons, an ok button and a cancel button. I'm wanting to be able to activate either button but, browsing the docs, I can't figure out how to do it.

    I've spotted the triggerAction() function but there doesn't seem to be a relevant item in the WebAction enum. I've also spotted the NavigationType enum which contains an NavigationTypeFormSubmitted item but that seems to only be used, after an event has been triggered, by the acceptNavigationRequest() function.

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

    Default Re: How to activate form buttons in a QWebPage

    You can do it via javascript. Until now this is the only way to manipulate the contents of a webpage using QtWebKit.
    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.


  3. #3
    Join Date
    Apr 2009
    Posts
    12

    Default Re: How to activate form buttons in a QWebPage

    Quote Originally Posted by wysota View Post
    You can do it via javascript. Until now this is the only way to manipulate the contents of a webpage using QtWebKit.
    Are there any examples of using javascript on QWebPage objects?

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

    Default Re: How to activate form buttons in a QWebPage

    Yes, you can find them on labs.qtsoftware.com
    But you can also see docs of QWebFrame and its QWebFrame::evaluateJavaScript method.
    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.


  5. #5
    Join Date
    Apr 2009
    Posts
    12

    Default Re: How to activate form buttons in a QWebPage

    Excellent, thanks. I'll check them out.

Similar Threads

  1. Replies: 4
    Last Post: 23rd June 2008, 17:11

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.