How to enter an email address

Ingo Klöcker kloecker at
Sun Oct 24 00:12:09 BST 2010

On Tuesday 12 October 2010, Rolf Eike Beer wrote:
> Ingo Klöcker wrote:
> > On Saturday 09 October 2010, Christoph Feck wrote:
> > > On Friday 08 October 2010 20:37:04 Rolf Eike Beer wrote:
> > > > Hi,
> > > > 
> > > > I was just wondering if there is a simple _and_ correct
> > > > solution for an "enter an email address" widget. In KGpg I use
> > > > a simple KLineEdit and
> > > 
> > > I think the simplest is probably using QRegExpValidator. Google
> > > should know a correct "email regexp".
> > 
> > I suggest reading "I Knew How To Validate An Email Address Until I
> > Read The RFC"
> >
> > il- address-until-i.aspx
> > 
> > Afterward you will hopefully agree that you should use what our
> > experts in this field provide in kdepimlibs instead of trying to
> > come up with a suboptimal solution involving a regular expression.
> Yes, of course. That's why I asked at all: when 3 developers will do
> it their own way at least 4 different bugs will appear.
> What about putting that validator class in kdelibs and just using it
> from kdepimlibs (with respect to BC)? Otherwise the "simple
> fallback" would have to be either too permissive (as being too
> strict would be a user experience nightmare) or a copy of that class
> anyway (with the downside that every change always has to be done
> twice).

I'm not sure moving it to kdelibs is such a good idea. kdepimlibs is a 
much more natural place to look for such functionality.

Moreover, I think the validator has extremely limited use. Most people 
will want to use the full-featured address line edit from kdepimlibs 
which provides auto-completion of addresses in the address book. In 
fact, even you should consider using this for KHTML because in 99.9 % of 
all cases (as usual, I made this number up) the user will have to enter 
his own email address which is already conveniently stored in his 
address book. So why should he have to enter his email address over and 
over again in all those different email input elements when auto-
completion could make his life much easier?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list