<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 12, 2013 at 2:57 AM, Albert Astals Cid <span dir="ltr"><<a href="mailto:aacid@kde.org" target="_blank">aacid@kde.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">El Dimecres, 12 de juny de 2013, a les 01:57:45, Jaydeep Solanki va escriure:<br>
<div class="im">> It would be great if you could suggest me something because I'm out of<br>
> ideas.<br>
<br>
</div>What's the problem? QtWebKit only working on Qt5? Well 4.8 has a QtWebKit too.<br>
Or where you planning to add new API?<br></blockquote><div>Yes, because subclassing wasn't helping.<br></div><div>In QWebView, there's a method findText(...), which marks all the found occurrences of the given string, but they do it through private classes, which cannot be accessed by a subclass.<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Cheers,<br>
  Albert<br>
<div class=""><div class="h5"><br>
><br>
> On Tue, Jun 11, 2013 at 11:44 PM, Albert Astals Cid <<a href="mailto:aacid@kde.org">aacid@kde.org</a>> wrote:<br>
> > El Dimarts, 11 de juny de 2013, a les 16:26:07, Jaydeep Solanki va<br>
> ><br>
> > escriure:<br>
> > > The current version of QtWebkit works only with Qt5, will that be a<br>
> ><br>
> > problem<br>
> ><br>
> > > ?<br>
> ><br>
> > Yes, closest estimate for Qt5 based Okular is at least 1 year from now,<br>
> > i'd<br>
> > prefer if we have something that works on current Okular.<br>
> ><br>
> > Cheers,<br>
> ><br>
> >   Albert<br>
> ><br>
> > > Cheers,<br>
> > > Jaydeep<br>
> > ><br>
> > > On Mon, Jun 10, 2013 at 1:02 PM, Jaydeep Solanki <<a href="mailto:jaydp17@gmail.com">jaydp17@gmail.com</a>><br>
> ><br>
> > wrote:<br>
> > > > On Sat, Jun 8, 2013 at 9:28 PM, Albert Astals Cid <<a href="mailto:aacid@kde.org">aacid@kde.org</a>><br>
> ><br>
> > wrote:<br>
> > > >> El Divendres, 7 de juny de 2013, a les 23:35:41, Jaydeep Solanki va<br>
> > > >><br>
> > > >> escriure:<br>
> > > >> > Will it be a good idea to look for something in QtWebkit source<br>
> > > >> > that<br>
> > > >> > can<br>
> > > >> > get us bounding rects ?<br>
> > > >><br>
> > > >> Makes sense, there is *something* in there that can select text, so<br>
> ><br>
> > there<br>
> ><br>
> > > >> is<br>
> > > >> information of where the text is.<br>
> > > >><br>
> > > >> Working on it.<br>
> > > >><br>
> > > >> Cheers,<br>
> > > >><br>
> > > >>   Albert<br>
> > > >><br>
> > > >> > Cheers,<br>
> > > >> > Jaydeep<br>
> > > >> ><br>
> > > >> > On Fri, Jun 7, 2013 at 3:41 AM, Jaydeep Solanki <<a href="mailto:jaydp17@gmail.com">jaydp17@gmail.com</a>><br>
> > > >><br>
> > > >> wrote:<br>
> > > >> > > But it will give the bounding rect of the HTML element, not the<br>
> ><br>
> > text.<br>
> ><br>
> > > >> We<br>
> > > >><br>
> > > >> > > can use the box of the HTML element to predict the bounding box<br>
> > > >> > > of<br>
> > > >><br>
> > > >> text<br>
> > > >><br>
> > > >> > > with the help of font metrics, but it will fail in situations<br>
> ><br>
> > with an<br>
> ><br>
> > > >> > > image<br>
> > > >> > > or a floating element between text.<br>
> > > >> > > Example: image <<br>
> > > >><br>
> > > >> <a href="http://s11.postimg.org/5ysz1z79v/wrapp_all_arround.png" target="_blank">http://s11.postimg.org/5ysz1z79v/wrapp_all_arround.png</a>><br>
> > > >><br>
> > > >> > > Cheers,<br>
> > > >> > > Jaydeep<br>
> > > >> > ><br>
> > > >> > > On Fri, Jun 7, 2013 at 2:41 AM, Albert Astals Cid <<a href="mailto:aacid@kde.org">aacid@kde.org</a>><br>
> > > >><br>
> > > >> wrote:<br>
> > > >> > >> El Dimarts, 4 de juny de 2013, a les 20:00:51, Jaydeep Solanki<br>
> > > >> > >> va<br>
> > > >> > >><br>
> > > >> > >> escriure:<br>
> > > >> > >> > On Mon, Jun 3, 2013 at 2:43 AM, Albert Astals Cid <<br>
> ><br>
> > <a href="mailto:aacid@kde.org">aacid@kde.org</a>><br>
> ><br>
> > > >> > >> wrote:<br>
> > > >> > >> > > El Dilluns, 3 de juny de 2013, a les 01:52:04, Jaydeep<br>
> ><br>
> > Solanki<br>
> ><br>
> > > >> > >> > > va<br>
> > > >> > >><br>
> > > >> > >> escriure:<br>
> > > >> > >> > > > Hi,<br>
> > > >> > >> > > > While working on getting text bounds work I discovered<br>
> > > >> > >> > > > that<br>
> > > >> > >> > > > QWebFrame::hitTestContent(QPoint()) hits the outermost<br>
> > > >> > >> > > > element,<br>
> > > >> > >><br>
> > > >> > >> inside<br>
> > > >> > >><br>
> > > >> > >> > > body.<br>
> > > >> > >> > ><br>
> > > >> > >> > > > Consider the below HTML,<br>
> > > >> > >> > > ><br>
> > > >> > >> > > > <section><br>
> > > >> > >> > > > <p id="p1">some text...</p><br>
> > > >> > >> > > > <div>...</div><br>
> > > >> > >> > > > <p id="p2">some other text..</p><br>
> > > >> > >> > > > </section><br>
> > > >> > >> > > ><br>
> > > >> > >> > > > Now we have two QPoints;<br>
> > > >> > >> > > > QPoint pt1 => which points somewhere within p1<br>
> > > >> > >> > > > QPoint pt2 => which points somewhere within p2<br>
> > > >> > >> > > ><br>
> > > >> > >> > > > var ht1 = QWebFrame::hitTestContent(pt1);<br>
> > > >> > >> > > > var ht2 = QWebFrame::hitTestContent(pt2);<br>
> > > >> > >> > ><br>
> > > >> > >> > > Why are you using hitTestContent to get the data? Isn't<br>
> > > >> > >> > > there<br>
> > > >> > >><br>
> > > >> > >> something<br>
> > > >> > >><br>
> > > >> > >> > > better? What's your plan? call hitTestContent for all the<br>
> ><br>
> > points<br>
> ><br>
> > > >> or?<br>
> > > >><br>
> > > >> > >> > Yes, I agree traversing the DOM is a better idea.<br>
> > > >> > >> ><br>
> > > >> > >> > I googled a bit & found that we cannot get the bounding rect<br>
> > > >> > >> > of<br>
> > > >><br>
> > > >> text<br>
> > > >><br>
> > > >> > >> from<br>
> > > >> > >><br>
> > > >> > >> > webkit<br>
> > > >> > >> > (source<<br>
> > > >><br>
> > > >> <a href="http://comments.gmane.org/gmane.os.opendarwin.webkit.qt/1130" target="_blank">http://comments.gmane.org/gmane.os.opendarwin.webkit.qt/1130</a>>),<br>
> > > >><br>
> > > >> > >> but<br>
> > > >> > >><br>
> > > >> > >> > we can get the bounding box of the HTML element. I don't get<br>
> ><br>
> > it,<br>
> ><br>
> > > >> why it<br>
> > > >><br>
> > > >> > >> > isn't possible, because in QWebView when we select any text,<br>
> > > >> > >> > it<br>
> > > >><br>
> > > >> gets<br>
> > > >><br>
> > > >> > >> > highlighted, which is basically filling color in the bounding<br>
> ><br>
> > box<br>
> ><br>
> > > >> of<br>
> > > >><br>
> > > >> > >> > the<br>
> > > >> > >> > text, which indirectly means that Webview knows the bounding<br>
> > > >><br>
> > > >> rects. Do<br>
> > > >><br>
> > > >> > >> > I<br>
> > > >> > >> > make sense ?<br>
> > > >> > >> > Please comment on this.<br>
> > > >> > >><br>
> > > >> > >> What about the suggestion in that very same url of using<br>
> > > >> > >> qwebelement?<br>
> > > >> > >><br>
> > > >> > >> Cheers,<br>
> > > >> > >><br>
> > > >> > >>   Albert<br>
> > > >> > >><br>
> > > >> > >> > & if everything fails, QFontMetrics may be of some use. We can<br>
> ><br>
> > get<br>
> ><br>
> > > >> the<br>
> > > >><br>
> > > >> > >> font<br>
> > > >> > >><br>
> > > >> > >> > metrics, & using it + the bounding box of the HTML element, we<br>
> ><br>
> > can<br>
> ><br>
> > > >> > >> predict<br>
> > > >> > >><br>
> > > >> > >> > the bounding rects.<br>
> > > >> > >> ><br>
> > > >> > >> > Cheers,<br>
> > > >> > >> > Jaydeep<br>
> > > >> > >> ><br>
> > > >> > >> > > Cheers,<br>
> > > >> > >> > ><br>
> > > >> > >> > >   Albert<br>
> > > >> > >> > ><br>
> > > >> > >> > > > Analysing ht1 & ht2 turns out that both of them point to<br>
> ><br>
> > the<br>
> ><br>
> > > >> > >> > > > section<br>
> > > >> > >> > > > element, which seems to be a little problem. I'm searching<br>
> ><br>
> > for<br>
> ><br>
> > > >> > >> > > > other<br>
> > > >> > >> > > > ways<br>
> > > >> > >> > > > to do it. If you have any idea to get it work, please<br>
> ><br>
> > share.<br>
> ><br>
> > > >> > >> > > > Cheers,<br>
> > > >> > >> > > > Jaydeep<br>
> > > >> > >> > ><br>
> > > >> > >> > > _______________________________________________<br>
> > > >> > >> > > Okular-devel mailing list<br>
> > > >> > >> > > <a href="mailto:Okular-devel@kde.org">Okular-devel@kde.org</a><br>
> > > >> > >> > > <a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
> > > >> > >><br>
> > > >> > >> _______________________________________________<br>
> > > >> > >> Okular-devel mailing list<br>
> > > >> > >> <a href="mailto:Okular-devel@kde.org">Okular-devel@kde.org</a><br>
> > > >> > >> <a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
> > > >><br>
> > > >> _______________________________________________<br>
> > > >> Okular-devel mailing list<br>
> > > >> <a href="mailto:Okular-devel@kde.org">Okular-devel@kde.org</a><br>
> > > >> <a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
> ><br>
> > _______________________________________________<br>
> > Okular-devel mailing list<br>
> > <a href="mailto:Okular-devel@kde.org">Okular-devel@kde.org</a><br>
> > <a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
_______________________________________________<br>
Okular-devel mailing list<br>
<a href="mailto:Okular-devel@kde.org">Okular-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
</div></div></blockquote></div><br></div></div>