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:[EMAIL PROTECTED]
> >
> > 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    [email protected]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to