[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs/kdeui/widgets
From:       David Faure <faure () kde ! org>
Date:       2008-12-31 15:56:29
Message-ID: 200812311656.30687.faure () kde ! org
[Download RAW message or body]

On Wednesday 31 December 2008, Rafael Fernández López wrote:
> Hi,
> 
> > Your commit was in klineedit.cpp
> > (r902990)
> 
> Ah, OK, this thread is about kcompletionbox...
> 
> The most important change on that commit is here:
> 
> ( keycode.unicode()->category() != QChar::Symbol_Modifier || txt != old_txt ) 

where txt != old_txt means:
"... or if the text has been modified since the last keyReleaseEvent",
since you update old_txt at the end of keyReleaseEvent.

My point is that it won't be updated if you use MMB or RMB, so the test will
not do what you want -- the text will appear to be modified, even if it wasn't
modified by this key event.

> Basically, it is possible to have pressed a key (for being more exact, 
> released a key, since there seems Qt has a bug, it won't trigger keyPressEvent 
> but twice keyReleaseEvent if pressed 'á', for instance) and don't need to 
> write something, this means: á, é, í, ó, ú in spanish. You type ''' but 
> nothing will be written till you hit later 'a', 'e', 'i', 'o' or 'u'.

You're talking about dead keys, right?  (or compose key?)

I'm still not convinced about the need to have special handling of dead keys in
KLineEdit/KCompletion, surely it should be transparent like in any other widget...
(maybe ev->text().isEmpty() is enough to detect "key events that don't contain
any text?")

> The old_txt approach was being used before but in a more local case (not being 
> an attribute).

Yes (you mean member), and I'm concerned that if it's turned into a member then
it has to be properly updated in all cases, otherwise this might create bugs.

> I don't see why would this break MMB or RMB use case. Can you provide me an 
> example, please ?

I haven't tested, but try MMB-paste and then ' + a, your "text has been modified"
condition will be true when pressing ' even if it normally is false.

-- 
David Faure, faure@kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic