[Kde-pim] KMail: "smart paste" of email addresses

Ingo Klöcker kloecker at kde.org
Mon Dec 17 20:18:24 GMT 2007


On Sunday 16 December 2007, Kevin Krammer wrote:
> Hi all,
>
> since a respective generic question on k-c-d got no reply for about a
> week now, I take it that it is no longer possible to intercept text
> going into a QLineEdit or its subclasses.
>
> Since the AddresseeLineEdit in libkdepim used this (i.e.
> reimplementing KLineEdit::paste(), KLineEdit::insert()) to implement
> the so called "smart paste" feature, it no longer works.
>
> From my somewhat limited investigation the only reasonable way to
> implement this now is to use a QValidator on the line edit and let it
> "fixup" the string.
> However, since intercepting paste() doesn't work any longer either,
> it could only be turned on/off on middle-mouse-button pastes, it will
> probably have to work continuously, i.e. not just when inserting text
> through pasting.
>
> Another option, though not totally equivalent in behavior, might be
> to implement this in the completion handler. Not totally equivalent
> because pasting doesn't seem to trigger completion by itself, but
> this might depend on the completion mode setting.
>
> Any preferences which way I should investigate further, or maybe any
> other option I am overlooking?

It's always possible to reimplement the *Event() methods, i.e. 
keyPressEvent(), and the mouse events. Just make sure that you handle 
all shortcuts of KStandardAction::paste().


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20071217/dc4d9699/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list