[PATCH] Open/Save dialog completion fix

Rafael Fernández López ereslibre at kde.org
Mon Dec 22 15:37:14 GMT 2008

Hi there,

When fixing some things on Open/Save dialog I noticed when you have 
autocompletion in a folder with items, for example: "foo", "bar". If you write 
on the location edit combo "fó" the completion still shows "foo", what is 
obviously wrong.

I have written a patch, but also on my debugging way I found a QLineEdit bug, 
at least I think is a bug, that has been already reported to Qt Software.

So, let's go step by step:

The attached patch fixes this problem, so if you write "f" the completion shows 
obviously "foo", while if you do "fó" the autocompletion combo is hidden, 
since there are no more hits. This seems mainly a porting problem (haven't 
tested if this works on KDE 3).

Now, why I changed keyPressEvent with keyReleaseEvent ? This is the second 
part of this issue. QLineEdit seems to have an issue. I have written two test 


On the first one (which is actually a QTestLib test case) you will see that if 
you "emulate" keyboard key presses, you get 5 key presses and 5 key releases 
when emulating "tést" writing.

On test2, which is an app with console output, writing "qué tal" will you get 
this on console (pasted here so it is easier for you):

[ereslibre at laptop-freedom:~/test2]$ ./test2
key press => q
key release
key press => u
key release
key release => é
key release
key press => 
key release
key press => t
key release
key press => a
key release
key press => l
key release

Basically, as you can see you don't get any key press event when writing "é". 
It is curious to check that if you write "´´´´´´´´" you only get key releases 
events too... so this sounds like a bug to me.

For this reason I changed the keyPressEvent to keyReleaseEvent on the patch.

So now the question is:

Should I commit this to SVN, or better wait till this QLineEdit is fixed in Qt 
and commit it on the keyPressEvent a bit modified, but following the same idea 

Rafael Fernández López.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdelibs.diff
Type: text/x-patch
Size: 5730 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081222/b7320f03/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081222/b7320f03/attachment.sig>

More information about the kde-core-devel mailing list