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

Kevin Krammer kevin.krammer at gmx.at
Tue Dec 18 20:15:05 GMT 2007


On Monday 17 December 2007, Ingo Klöcker wrote:
> 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().

Right, but the text still has to be intercepted somewhere and the contextmenu 
paste would also have to be handled.

Kind of weird that the widget setters are no longer virtual.

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20071218/4253539e/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