[webkit-qt] feature request: get selection rect

Roman Evstifeev someuniquename at gmail.com
Thu Apr 29 12:59:51 PDT 2010


2010/4/29 Benjamin Poulain <benjamin.poulain at nokia.com>:
> ext Roman Evstifeev wrote:
>>
>> Can something like this be added to QtWebKit? (mybe in more appropriate
>> place)
>>
>> QRectF QWebPage::selectionRect() const {
>>  return
>> d->page->focusController()->focusedOrMainFrame()->selectionBounds(false);
>> }
>>
>> Usecase:
>> I need to know current selection Rect, because i have few QWebViews
>> lined up, and showed in the scrollArea.
>> (see screenshot
>>
>> http://kde-apps.org/content/preview.php?preview=1&id=122981&file1=122981-1.png&file2=&file3=&name=NExp
>> )
>> Scrollbars of QWebViews a turned off, and i need to scroll with my
>> scrollArea to the selection, like a single QWebView does.
>> knowing selectionRect i easily can know the position, to which i should
>> scroll.
>
> Is the selection done by the search of text? We know we have a missing API
> to scroll to a position when the view should:
> -scroll to an anchor
> -scroll to the selected text of a search
>
> Is your case another usecase?
>
> Benjamin
>
In my usecase user performs a search, and i need to know the position
(and the bounding rect) of the search result (to perform scroll to the
position).


More information about the webkit-qt mailing list