Version: (using KDE KDE 3.5.6) Installed from: Ubuntu Packages OS: Linux I came across a problem with the selection when selecting text inside a <input type="text"> field (in textareas it works correctly). In the case of type="text" the returned value is always equal to the *end* value of the selection (selectionStart and selectionEnd return the same value). Please try the attached test case. There are six letters, a-f. If I select the letters "cd" from left to right I get "Start 4, End 4", if I select from right to left I get "Start: 2, End: 2". For the textarea I get "Start: 2, End: 4" for both directions, as I would expect. For comparison: Firefox returns "Start: 2, End: 4" for both directions and both fields.
Created attachment 19869 [details] Test case to demonstrate the problem
- In trunk the problem is there, too. - The problem seems to be that w->hasSelectedText() returns false in RenderLineEdit::selectionStart() and RenderLineEdit::selectionEnd() even though text is selected.
Can confirm. Makes me wonder how the heck I tested that when implementing it..
Hmm, what's the source of your Qt? Distro packages, or?
Never mind that. I think what it's reporting is accurate, since when you click elsewhere, the lineedit loses focus, and with it selection (not sure -why- it does that yet). It probably "worked" for me before because the focus handling was buggy.
void QLineEdit::focusOutEvent( QFocusEvent* ) { if ( QFocusEvent::reason() != QFocusEvent::ActiveWindow && QFocusEvent::reason() != QFocusEvent::Popup ) deselect(); ... This may be tricky, since the behavior depends on the ordering of events, and we have to be very aggressive about delivering focus events to widgets, since otherwise Qt can get pretty confused...
Unfortunately what you've written in #6 is way above my head... I hope it wasn't meant for me. :) ----- For the sake of completeness, here are the data: Compiled from svn on a Debian unstable: $ konqueror -v Qt: 4.3.0beta KDE: 3.80.3 (>= 20070220) Konqueror: 3.80.3 and stock binary packages on Kubuntu (feisty): $ konqueror -v Qt: 3.3.7 KDE: 3.5.6 Konqueror: 3.5.6 I see the problem on both.
This issue still exists in kde4 trunk (r.799086).
Bug still valid with KDE 4.4.5 and 4.5.1
Confirmed in 4.5.4, updating version.
Thank you for the bug report. As this report hasn't seen any changes in 10 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved.