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

List:       pykde
Subject:    Re: [PyKDE] Active links in a QLabel
From:       Jim Bublitz <jbublitz () nwinternet ! com>
Date:       2004-08-17 17:06:33
Message-ID: 200408171006.33930.jbublitz () nwinternet ! com
[Download RAW message or body]

On Tuesday 17 August 2004 09:12, Detlev Offenbach wrote:

> I would like to display active links (like the one to the eric3 homepage)
> in the about message box. I was able to get them show as links. However,
> clicking on them didn't do anything.

Neither QLabel (nor its base classes QFrame/QWidget) emit any signals, so 
you'd have to subclass it and overload one or more of the mouse*Event and 
keyPressEvent methods to capture the clicks/key presses, and then either 
directly or via a signal launch a browser and pass it the URL.

Alternatively, you'd could derive something from QButton (abstract), which 
emits the necessary signals, but then you have to provide the paint code.

I'm didn't find a "link" type widget in Qt (although that doesn't mean there 
isn't one - I'm kind of surprised there isn't any). KDE has a KURLLabel, 
which I realize doesn't do you much good, but you could use the C++ code for 
that as a reference (it does things like changing the cursor during 
"mouse-over" too).

Jim

_______________________________________________
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