TeeT
16th April 2015, 22:12
Hello Everyone,
Super QT newbie here. I was hoping someone could help with a problem I'm having. I'm looking for an example of how to get the geometry from a QWebElement. I've been looking and haven't seen any examples to find the geometry. Currently my code looks like this:
Opage = new QWebPage(this);
Opage->mainFrame()->setHtml(reply->readAll());
QWebElement doc = Opage->mainFrame()->documentElement();
QWebElementCollection elements = doc.findAll("div");
foreach (QWebElement element, elements)
{
QString height = element.geometry().height();
qDebug() << height ;
}
This prints out nothing. I also tried another case setting my element = doc.firstChild() but that also prints nothing. I am sure that I'm connecting and I have found attributes using doc.findall("div"). Do I need to use QWebView to see the dimensions? Or might I be over looking something simple?
Thanks in advance!
Super QT newbie here. I was hoping someone could help with a problem I'm having. I'm looking for an example of how to get the geometry from a QWebElement. I've been looking and haven't seen any examples to find the geometry. Currently my code looks like this:
Opage = new QWebPage(this);
Opage->mainFrame()->setHtml(reply->readAll());
QWebElement doc = Opage->mainFrame()->documentElement();
QWebElementCollection elements = doc.findAll("div");
foreach (QWebElement element, elements)
{
QString height = element.geometry().height();
qDebug() << height ;
}
This prints out nothing. I also tried another case setting my element = doc.firstChild() but that also prints nothing. I am sure that I'm connecting and I have found attributes using doc.findall("div"). Do I need to use QWebView to see the dimensions? Or might I be over looking something simple?
Thanks in advance!