How to enter an email address

Tom Albers toma at kde.org
Fri Oct 8 19:47:05 BST 2010



----- Oorspronkelijk bericht -----
> 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
> afterwards
> throw the contents into KPIMUtils::isValidSimpleAddress(). Linking to
> kdepimlibs doesn't hurt there as I need the address book stuff anyway.
> 
> But what to do on other places? One thing that came to my mind would
> be the
> <input type="email"> from HTML5. Depending on kdepimlibs for KHTML is
> not an
> option. And I think it would also be cool to immediately stop the user
> from
> entering invalid addresses. KRestrictedLine could do half of this but
> would
> not stop one from entering foo at example@org or other junk.
> 
> So the question is: do we have a simple widget that would do this? If
> not, why
> not? Entering email addresses (and URLs, that would be the next to
> come up) is
> something most programs do these days. Assisting the user and
> developer here
> would make totally sense to me.
> 
> Eike

There is a QValidator based one:
http://api.kde.org/4.x-api/kdepimlibs-apidocs/kpimutils/html/classKPIMUtils_1_1EmailValidator.html

Best,
-- 
Tom Albers
KDE Sysadmin




More information about the kde-core-devel mailing list