Using this function:
void QWebView::linkClicked ( const QUrl & url ) [signal]
This signal is emitted whenever the user clicks on a link and the page's linkDelegationPolicy property is set to delegate the link handling for the specified url.
You can access the HTML code as follows:
QString Widget::evalJS(const QString &js)
{
QWebFrame *frame = ui->webView->page()->mainFrame();
return frame->evaluateJavaScript(js).toString();
}
evalJS(QString("document.forms[\"f\"].text.value = \"%1\";").arg(fromText));
evalJS(QString("document.forms[\"f\"].langSelect.value = \"%1\";").arg(langText));
evalJS(QString("translate()"));
QString from = evalJS("document.forms[\"f\"].text.value");
QString translation = evalJS("document.forms[\"f\"].translation.value");
ui->textEditTo->setText(translation);