[Okular-devel] Epub - webkit, getting text bounds

Albert Astals Cid aacid at kde.org
Sun Jun 2 21:13:30 UTC 2013


El Dilluns, 3 de juny de 2013, a les 01:52:04, Jaydeep Solanki va escriure:
> Hi,
> While working on getting text bounds work I discovered that
> QWebFrame::hitTestContent(QPoint()) hits the outermost element, inside body.
> 
> Consider the below HTML,
> 
> <section>
> <p id="p1">some text...</p>
> <div>...</div>
> <p id="p2">some other text..</p>
> </section>
> 
> Now we have two QPoints;
> QPoint pt1 => which points somewhere within p1
> QPoint pt2 => which points somewhere within p2
> 
> var ht1 = QWebFrame::hitTestContent(pt1);
> var ht2 = QWebFrame::hitTestContent(pt2);

Why are you using hitTestContent to get the data? Isn't there something 
better? What's your plan? call hitTestContent for all the points or?

Cheers,
  Albert

> 
> Analysing ht1 & ht2 turns out that both of them point to the section
> element, which seems to be a little problem. I'm searching for other ways
> to do it. If you have any idea to get it work, please share.
> 
> Cheers,
> Jaydeep


More information about the Okular-devel mailing list