Hi all!

I've been searching the internet for how follow a <a href> hyperlink on Qt Webkit, and as I found nothing about it, I am now asking for help in this forum.

I've tested with this code:
Qt Code:
  1. void MainWindow::putPagina1()
  2. {
  3. QWebElement el = ui->webView->page()->mainFrame()->findFirstElement("a[href]");
  4. el.evaluateJavaScript("this.click()");
  5.  
  6.  
  7. }
To copy to clipboard, switch view to plain text mode 

The source code of the website is as follows:
Qt Code:
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <h1><a href="button1.html">Click here if you are button 1</a></h1>
  6. <h1><a href="button2.html">Click here if you are button 2</a></h1>
  7. </body>
  8. </html>
To copy to clipboard, switch view to plain text mode 

The idea is this: when you press button1, the browser displays button1.html and when you press button2, the browser displays button2.html .

Thank you!