<div dir="ltr">It would be great if you could suggest me something because I'm out of ideas.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 11, 2013 at 11:44 PM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">El Dimarts, 11 de juny de 2013, a les 16:26:07, Jaydeep Solanki va escriure:<br>
<div class="im">> The current version of QtWebkit works only with Qt5, will that be a problem<br>
> ?<br>
<br>
</div>Yes, closest estimate for Qt5 based Okular is at least 1 year from now, i'd<br>
prefer if we have something that works on current Okular.<br>
<div class="HOEnZb"><div class="h5"><br>
Cheers,<br>
Albert<br>
<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>> wrote:<br>
> > On Sat, Jun 8, 2013 at 9:28 PM, Albert Astals Cid <<a href="mailto:aacid@kde.org">aacid@kde.org</a>> 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 that<br>
> >> > can<br>
> >> > get us bounding rects ?<br>
> >><br>
> >> Makes sense, there is *something* in there that can select text, so there<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 text.<br>
> >><br>
> >> We<br>
> >><br>
> >> > > can use the box of the HTML element to predict the bounding box of<br>
> >><br>
> >> text<br>
> >><br>
> >> > > with the help of font metrics, but it will fail in situations with an<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 va<br>
> >> > >><br>
> >> > >> escriure:<br>
> >> > >> > On Mon, Jun 3, 2013 at 2:43 AM, Albert Astals Cid <<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 Solanki<br>
> >> > >> > > va<br>
> >> > >><br>
> >> > >> escriure:<br>
> >> > >> > > > Hi,<br>
> >> > >> > > > While working on getting text bounds work I discovered 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 there<br>
> >> > >><br>
> >> > >> something<br>
> >> > >><br>
> >> > >> > > better? What's your plan? call hitTestContent for all the 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 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 it,<br>
> >><br>
> >> why it<br>
> >><br>
> >> > >> > isn't possible, because in QWebView when we select any text, it<br>
> >><br>
> >> gets<br>
> >><br>
> >> > >> > highlighted, which is basically filling color in the bounding 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 get<br>
> >><br>
> >> the<br>
> >><br>
> >> > >> font<br>
> >> > >><br>
> >> > >> > metrics, & using it + the bounding box of the HTML element, we 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 the<br>
> >> > >> > > > section<br>
> >> > >> > > > element, which seems to be a little problem. I'm searching for<br>
> >> > >> > > > other<br>
> >> > >> > > > ways<br>
> >> > >> > > > to do it. If you have any idea to get it work, please 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>
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>