class KUrlLabel


Table of contents
Modules
kdeui Classes
All Classes
Module kdeui
Namespace global
Class KUrlLabel
Inherits QLabel

A drop-in replacement for QLabel that displays hyperlinks.

KUrlLabel is a drop-in replacement for QLabel that handles text in a fashion similar to how an HTML widget handles hyperlinks. The text can be underlined (or not) and set to different colors. It can also "glow" (cycle colors) when the mouse passes over it.

KUrlLabel also provides signals for several events, including the mouse leaving and entering the text area and all forms of mouse clicking.

By default KUrlLabel accepts focus. When focused, standard focus rectangle is displayed as in HTML widget. Pressing Enter key accepts the focused label.

A typical usage would be something like so:

KUrlLabel *address = new KUrlLabel(this);
address->setText("My homepage");
address->setUrl("http://www.home.com/~me");
connect(address, SIGNAL(leftClickedUrl(const QString&)),
SLOT(processMyUrl(const QString&)));

In this example, the text "My homepage" would be displayed as blue, underlined text. When the mouse passed over it, it would "glow" red. When the user clicks on the text, the signal leftClickedUrl() would be emitted with "http://www.home.com/~me" as its argument.

Author Kurt Granroth (Interface) Author Peter Putzer (Rewrite)



methods