I have a simple Qt GUI application that uses QtWebkit. I am loading a complex page with a lot of IFRAME nested tags. And I want to go through the full DOM tree (like the Chrome browser in the debug panel), including the contents of the frames.
My code is:
QWebElement doc = ui->webView->page()->mainFrame()->documentElement(); QWebElement iframe = doc.findFirst("iframe[id=someid]"); QWebFrame *webFrame = ....?
Note: I can navigate through all frames (including nested frames):
void MainWindow::renderFramesTree(QWebFrame *frame, int indent) { QString s; s.fill(' ', indent * 4); ui->textLog->appendPlainText(s + " " + frame->frameName()); foreach (QWebFrame *child, frame->childFrames()) renderFramesTree(child, indent + 1); }
But this is not my question. I need to get the corresponding QWebFrame * iframe-QWebElement.
Thanx!
source share