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

List:       pykde
Subject:    Re: [PyKDE] Implement MailTo in QT
From:       David Boddie <david () boddie ! org ! uk>
Date:       2006-11-16 13:40:48
Message-ID: 200611161440.48585.david () boddie ! org ! uk
[Download RAW message or body]

On Thursday 16 November 2006 17:23:37 +0700, Keo Sophon wrote: 

> On Wednesday 15 November 2006 16:36, Andreas Pakulat wrote:

> > With Qt4.2 you could use QDesktopServices and run openUrl with
> > mailto:foobar@somename.com.
> >
> > With Qt4.1/Qt3 you have to write platform-dependent code.

> I am using Qt4.1. The problem has been solved already. The following is part 
> of code:

[...]

>         def handleLinkClicked(self, url):
>         '''slot to handle when anchorClicked (an email address), and open a
>         webbrowser and a mail client'''
>         self.sender().setSource(QtCore.QUrl())
>         try:
>             import webbrowser
>             webbrowser.open(unicode(url.toString()))
>             return
>         except:
>             pass

For Qt 4.1-based code, you could also use the desktop module to open URLs:

  http://www.python.org/pypi/desktop

It aims to do much the same as what you want, but takes users' preferences
into account when choosing which WWW browser to open.

David

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

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

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