Thanks for the reply ThatDude.
Does button.click() change i.e. adds/removes elements or it changes properties of existing elements?
It adds elements to a static table element. It doesn't change the properties (that I'm aware of), but appends to it.
you should try to find these web elements starting from webView->page()->mainFrame()->documentElement() again
I tried doing that. During debugging I saw that the javascript is not evaluated immediately upon returning to the main loop. Instead, the slot corresponding to the signal I emitted is called immediately and the javascript is not called until sendpostedevents() is reached in the stack. I ended up finding a workaround by not calling the javascript and loading the html I found in the jQuery arguments, but I'm still curious as to how I COULD have reloaded the DOM. It seems that just doing the same
@QWebFrame *frame = webView->page()->mainFrame();
QWebElement document = frame->documentElement();@
after the javascript call might work, but I think I would have to add a slot for some signal that told me that the javascript result had been returned. Otherwise the DOM is reloaded before the javascript is even executed.