[webkit-qt] Question about QWebPage::inputMethodQuery(Qt::ImCursorPosition)

rajiv.ramanasankaran at nokia.com rajiv.ramanasankaran at nokia.com
Wed May 5 14:43:23 PDT 2010


Hi All,

I noticed that QWebPage::inputMethodQuery(Qt::ImCursorPosition) seems to prefer to return the end index (renderTextControl->selectionEnd()) of a selection inside an input field. This seems to work correctly and return the current cursor position when the user is just traversing the characters (in which case the selection is empty and start=end index) OR when the user starts selecting the text (or a part of it) in a LEFT to RIGHT direction with respect to a base starting position.

But if the text is selected from RIGHT to LEFT, the cursor position is always equal to the base index (basically the end index) from where the text selection was started and never changes as the selection moves left.

Not sure if this is a bug or my understanding is incorrect but it seems different from how this works in a QLineEdit. I was thinking instead of returning

renderTextControl->selectionEnd()

it should return something like:

frame->selection()->extent().offsetInContainerNode()

since the extent offset always has the current cursor position inside an input field.

Can someone please confirm?
Thanks,

--Rajiv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20100505/ba26e00e/attachment.html>


More information about the webkit-qt mailing list