PDA

View Full Version : How to use a public Qwebelement variable



luisvt
28th October 2012, 08:24
Hello, when I try to use the Qwebelement as a public variable, it doesn't work. For this reason I want to know what am I doing wrong?

This is my code:

Header


private: QWebElement *element;



Cpp


element = ui->webView->page()->currentFrame()->findFirstElement("#"+ElementID);



However the compiler send me some errors and I am not sure how to solve that

Zlatomir
28th October 2012, 11:22
First a recommendation: always tell us the error you get (when you get one).

Anyway the most obvious problem is that conforming to the documentation findFirstElement (http://doc.qt.digia.com/qt/qwebframe.html#findFirstElement) returns a QWebElement object and you try to assign that to a QWebElement* (use an object instead of a pointer to hold a copy of that return value).

If you are having a different problem please write more information.