Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6529739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:40:17+00:00 2026-05-25T09:40:17+00:00

I’m currently trying to receive some information from QWebView but unfortunately fail. How do

  • 0

I’m currently trying to receive some information from QWebView but unfortunately fail.

How do I find out which fields the user did change in a form? There may be several including hidden ones which I’m not interested in, I only want information about which ones were altered by the user. (One method for this would be to list all forms and inputs with evaluateJavaScript() and check them later, but this is ugly and doesn’t help with the second problem)

Also I want to know information about the form itself. What was the name, method and action?

QWebPage currently only provides a override of acceptNavigationRequest() with type NavigationTypeFormSubmitted which doesn’t help me as it doesn’t give me any of these information.

Thank you for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:40:17+00:00Added an answer on May 25, 2026 at 9:40 am

    Ok, after reading some of the “Related” questions here I eventually found that the only way may be JavaScript.

    My solution is below. After changing data on the website, m_changedInputs contains information about which forms and which inputs have been changed.

    CustomWebPage::CustomWebPage(QWidget *parent)
    : QWebPage(parent)
    {
        connect(this, SIGNAL(loadFinished(bool)), this, SLOT(onLoadFinished(bool)));
    }
    
    ...
    
    void CustomWebPage::onLoadFinished(bool ok)
    {
        // Do nothing on fail
        if ( !ok )
            return;
    
        // Clear all cached data
        m_changedInputs.clear();
    
        // Get the main frame
        QWebFrame* frame = mainFrame();
        frame->addToJavaScriptWindowObject("pluginCreator", this);
    
        // Find the form
        QWebElementCollection forms = frame->findAllElements("form");
    
        // Iterate the forms
        foreach(QWebElement form, forms) {
            // Determine the name of the form
            QString formName = form.attribute("name");
    
            // Find the forms' input elements
            QWebElementCollection inputs = form.findAll("input");
    
            // Iterate the inputs
            foreach(QWebElement input, inputs) {
                input.setAttribute("onchange", QString("pluginCreator.onInputChanged(\"%1\", this.name);").arg(formName));
            }
        }
    }
    
    void CustomWebPage::onInputChanged(const QString& formName, const QString& inputName)
    {
        qDebug() << "Form (" << formName << ") data changed:" << inputName;
    
        // Make sure we only have each input once. A QSet would also do the trick.
        QStringList& inputNames = m_changedInputs[formName];
        if ( !inputNames.contains(inputName) )
            inputNames.append(inputName);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a text area in my form which accepts all possible characters from
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.