Not sure what is going on here. I'm loading some HTML in a QWebView and wanting to set the value of a <textarea> field.

I already have a valid QWebElement reference to the element.

Doing this does not work:
QWebElement element = frame->findFirstElement("#myElement");
element.setAttribute("value", "some value");
qDebug() << "Attribute is:" << element.attribute("value"); // will output "some value"

So the attribute is set, but visually the value of the text area is still blank.

However this does work:
QWebElement element = frame->findFirstElement("#myElement");
element.evaluateJavascript("this.value='some value';");

Now the textarea has "some value" in it as expected.

Anyone know why the first method doesn't work?