I am trying to write a simple log viewer using the port / implementation of Qt4 WebKit. My HTML code is as follows:
http://pastie.org/613296
In particular, I'm trying to figure out how to call the add_message () function, which is defined in a section <script>in an HTML document from my C ++ code.
QWebElement targetElement = chatView->page()->mainFrame()->findFirstElement("head").firstChild("script");
qDebug() << targetElement.tagName() << targetElement.functions();
QVariant functionResult = targetElement.callFunction("add_message");
Bastibense
source
share