mardi 21 avril 2015

Qt 5.4 return data from JavaScript function using document.getElementById

In QWebFrame.h there's a function evaluateJavaScript that returns a QVariant. In my app I've got a JavaScript function something like

return document.getElementById('theId').outerHTML when I call this function from the evaluateJavaScript Qt function I get back garbage as the QVariant (why I then turn into a QString). In my case if I use jQuery to get the HTML of the element I get the expected return value.

Even with simple cases it seems that document.getElementById does not work with Qt.

Is there a workaround besides adding another library like jQuery?

Aucun commentaire:

Enregistrer un commentaire