I'm trying to write a simple log viewer using Qt4's WebKit port/implementation. My HTML code looks like this:
http://pastie.org/613296
More specifically, I'm trying to find out how to call the add_message() function which is defined in the <script>
section in the HTML document from my C++ code.
// Doesn't work:
QWebElement targetElement = chatView->page()->mainFrame()->findFirstElement("head").firstChild("script");
// Function is not included, either...
qDebug() << targetElement.tagName() << targetElement.functions();
// The ultimate attempt in calling the function anyway:
QVariant functionResult = targetElement.callFunction("add_message");