.TH "KURLLabel" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KURLLabel \- A drop-in replacement for \fBQLabel\fP that displays hyperlinks.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kurllabel.h>\fP
.PP
Inherits \fBQLabel\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetUnderline\fP (bool on=true)"
.br
.ti -1c
.RI "void \fBsetURL\fP (const \fBQString\fP &url)"
.br
.ti -1c
.RI "virtual void \fBsetFont\fP (const \fBQFont\fP &)"
.br
.ti -1c
.RI "void \fBsetUseTips\fP (bool on=true)"
.br
.ti -1c
.RI "void \fBsetTipText\fP (const \fBQString\fP &tip)"
.br
.ti -1c
.RI "void \fBsetHighlightedColor\fP (const \fBQColor\fP &highcolor)"
.br
.ti -1c
.RI "void \fBsetHighlightedColor\fP (const \fBQString\fP &highcolor)"
.br
.ti -1c
.RI "void \fBsetSelectedColor\fP (const \fBQColor\fP &selcolor)"
.br
.ti -1c
.RI "void \fBsetSelectedColor\fP (const \fBQString\fP &selcolor)"
.br
.ti -1c
.RI "void \fBsetUseCursor\fP (bool on, \fBQCursor\fP *cursor=0L)"
.br
.ti -1c
.RI "void \fBsetGlow\fP (bool glow=true)"
.br
.ti -1c
.RI "void \fBsetFloat\fP (bool do_float=true)"
.br
.ti -1c
.RI "void \fBsetAltPixmap\fP (const \fBQPixmap\fP &altPix)"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBenteredURL\fP (const \fBQString\fP &url)"
.br
.ti -1c
.RI "void \fBenteredURL\fP ()"
.br
.ti -1c
.RI "void \fBleftURL\fP (const \fBQString\fP &url)"
.br
.ti -1c
.RI "void \fBleftURL\fP ()"
.br
.ti -1c
.RI "void \fBleftClickedURL\fP (const \fBQString\fP &url)"
.br
.ti -1c
.RI "void \fBleftClickedURL\fP ()"
.br
.ti -1c
.RI "void \fBrightClickedURL\fP (const \fBQString\fP &url)"
.br
.ti -1c
.RI "void \fBrightClickedURL\fP ()"
.br
.ti -1c
.RI "void \fBmiddleClickedURL\fP (const \fBQString\fP &url)"
.br
.ti -1c
.RI "void \fBmiddleClickedURL\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURLLabel\fP (\fBQWidget\fP *parent=0L, const char *name=0L)"
.br
.ti -1c
.RI "\fBKURLLabel\fP (const \fBQString\fP &url, const \fBQString\fP &\fBtext\fP=QString::null, \fBQWidget\fP *parent=0L, const char *name=0L)"
.br
.ti -1c
.RI "virtual \fB~KURLLabel\fP ()"
.br
.ti -1c
.RI "const \fBQString\fP & \fBurl\fP () const "
.br
.ti -1c
.RI "const \fBQString\fP & \fBtipText\fP () const "
.br
.ti -1c
.RI "bool \fBuseTips\fP () const "
.br
.ti -1c
.RI "bool \fBuseCursor\fP () const "
.br
.ti -1c
.RI "bool \fBisGlowEnabled\fP () const "
.br
.ti -1c
.RI "bool \fBisFloatEnabled\fP () const "
.br
.ti -1c
.RI "const \fBQPixmap\fP * \fBaltPixmap\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBmouseReleaseEvent\fP (\fBQMouseEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBenterEvent\fP (\fBQEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBleaveEvent\fP (\fBQEvent\fP *)"
.br
.ti -1c
.RI "virtual bool \fBevent\fP (\fBQEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "\fBQString\fP \fBurl\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBtipText\fP"
.br
.ti -1c
.RI "\fBQPixmap\fP \fBaltPixmap\fP"
.br
.ti -1c
.RI "bool \fBglowEnabled\fP"
.br
.ti -1c
.RI "bool \fBfloatEnabled\fP"
.br
.ti -1c
.RI "bool \fBuseTips\fP"
.br
.ti -1c
.RI "bool \fBuseCursor\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A drop-in replacement for \fBQLabel\fP that displays hyperlinks. 

KURLLabel is a drop-in replacement for \fBQLabel\fP 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.
.PP
KURLLabel also provides signals for several events, including the mouse leaving and entering the text area and all forms of mouse clicking.
.PP
A typical usage would be something like so:
.PP
.PP
.nf
 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&)));
.fi
.PP
.PP
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 \fBleftClickedURL()\fP would be emitted with 'http://www.home.com/~me' as its argument.
.PP
KDE URL Label 
.PP
\fBAuthor:\fP
.RS 4
Kurt Granroth <granroth@kde.org> (Interface) 
.PP
Peter Putzer <putzer@kde.org> (Rewrite) 
.RE
.PP
\fBVersion:\fP
.RS 4
\fBId\fP.RS 4
\fBkurllabel.h\fP 345236 2004-09-09 15:23:55Z dfaure 
.RE
.PP
.RE
.PP

.PP
Definition at line 66 of file kurllabel.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURLLabel::KURLLabel (\fBQWidget\fP * parent = \fC0L\fP, const char * name = \fC0L\fP)"
.PP
Default constructor. 
.PP
Use \fBsetURL()\fP and \fBsetText()\fP or QListView::setPixmap() to set the resp. properties. 
.PP
Definition at line 84 of file kurllabel.cpp.
.PP
References setFont().
.SS "KURLLabel::KURLLabel (const \fBQString\fP & url, const \fBQString\fP & text = \fCQString::null\fP, \fBQWidget\fP * parent = \fC0L\fP, const char * name = \fC0L\fP)"
.PP
Convenience constructor. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP is the URL emitted when the label is clicked. 
.br
\fItext\fP is the displayed string. If it's equal to QString::null the \fCurl\fP will be used instead. 
.br
\fIparent\fP Passed to lower level constructor 
.br
\fIname\fP Passed to lower level constructor
.RE
.PP
\fCparent\fP and \fCname\fP are passed to \fBQLabel\fP, which in turn passes them further down 
.PP
Definition at line 74 of file kurllabel.cpp.
.PP
References setFont().
.SS "KURLLabel::~\fBKURLLabel\fP ()\fC [virtual]\fP"
.PP
Destructs the label. 
.PP
Definition at line 93 of file kurllabel.cpp.
.SH "Member Function Documentation"
.PP 
.SS "const \fBQString\fP& KURLLabel::url () const"
.PP
Returns the URL. 
.PP
.SS "const \fBQString\fP& KURLLabel::tipText () const"
.PP
Returns the current tooltip text. 
.PP
.SS "bool KURLLabel::useTips () const"
.PP
\fBReturns:\fP
.RS 4
true if a tooltip will be displayed.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetTipText()\fP 
.RE
.PP

.SS "bool KURLLabel::useCursor () const"
.PP
\fBReturns:\fP
.RS 4
true if the cursor will change while over the URL.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetUseCursor\fP () 
.RE
.PP

.SS "bool KURLLabel::isGlowEnabled () const"
.PP
When this is on, the text will switch to the selected color whenever the mouse passes over it. 
.PP
Definition at line 258 of file kurllabel.cpp.
.SS "bool KURLLabel::isFloatEnabled () const"
.PP
This feature is very similar to the 'glow' feature in that the color of the label switches to the selected color when the cursor passes over it. 
.PP
In addition, underlining is turned on for as long as the mouse is overhead. Note that if 'glow' and underlining are both already turned on, this feature will have no visible effect. 
.PP
Definition at line 263 of file kurllabel.cpp.
.SS "const \fBQPixmap\fP* KURLLabel::altPixmap () const"
.PP
\fBReturns:\fP
.RS 4
the alternate pixmap (may be 0L if none was set). 
.RE
.PP

.SS "void KURLLabel::setUnderline (bool on = \fCtrue\fP)\fC [slot]\fP"
.PP
Turns on or off the underlining. 
.PP
When this is on, the text will be underlined. By default, it is \fCtrue\fP. 
.PP
Definition at line 135 of file kurllabel.cpp.
.PP
References setFont().
.PP
Referenced by KDialogBase::enableLinkedHelp(), enterEvent(), and leaveEvent().
.SS "void KURLLabel::setURL (const \fBQString\fP & url)\fC [slot]\fP"
.PP
Sets the URL for this label to \fCurl\fP. 
.PP
\fBSee also:\fP
.RS 4
\fBurl\fP 
.RE
.PP

.PP
Definition at line 159 of file kurllabel.cpp.
.PP
References setUseTips().
.SS "void KURLLabel::setFont (const \fBQFont\fP &)\fC [virtual, slot]\fP"
.PP
Overridden for internal reasons; the API remains unaffected. 
.PP
Reimplemented from \fBQLabel\fP.
.PP
Definition at line 127 of file kurllabel.cpp.
.PP
References QLabel::setFont(), and QFont::setUnderline().
.PP
Referenced by KURLLabel(), and setUnderline().
.SS "void KURLLabel::setUseTips (bool on = \fCtrue\fP)\fC [slot]\fP"
.PP
Turns on or off the tool tip feature. 
.PP
When this is on, the URL will be displayed as a tooltip whenever the mouse passes passes over it. By default, it is \fCfalse\fP. 
.PP
Definition at line 195 of file kurllabel.cpp.
.PP
References QToolTip::add(), and QToolTip::remove().
.PP
Referenced by setTipText(), and setURL().
.SS "void KURLLabel::setTipText (const \fBQString\fP & tip)\fC [slot]\fP"
.PP
Specifies what text to display when tooltips are turned on. 
.PP
If this is not used, the tip will default to the URL.
.PP
\fBSee also:\fP
.RS 4
\fBsetUseTips()\fP 
.RE
.PP

.PP
Definition at line 205 of file kurllabel.cpp.
.PP
References setUseTips().
.SS "void KURLLabel::setHighlightedColor (const \fBQColor\fP & highcolor)\fC [slot]\fP"
.PP
Sets the highlight color. 
.PP
This is the default foreground color (non-selected). By default, it is \fCblue\fP. 
.PP
Definition at line 222 of file kurllabel.cpp.
.PP
Referenced by setHighlightedColor().
.SS "void KURLLabel::setHighlightedColor (const \fBQString\fP & highcolor)\fC [slot]\fP"
.PP
This is an overloaded version for convenience. 
.PP
\fBSee also:\fP
.RS 4
\fBsetHighlightedColor()\fP 
.RE
.PP

.PP
Definition at line 230 of file kurllabel.cpp.
.PP
References setHighlightedColor().
.SS "void KURLLabel::setSelectedColor (const \fBQColor\fP & selcolor)\fC [slot]\fP"
.PP
Sets the selected color. 
.PP
This is the color the text will change to when either a mouse passes over it and 'glow' mode is on or when it is selected (clicked). By default, it is \fCred\fP. 
.PP
Definition at line 235 of file kurllabel.cpp.
.PP
Referenced by setSelectedColor().
.SS "void KURLLabel::setSelectedColor (const \fBQString\fP & selcolor)\fC [slot]\fP"
.PP
This is an overloaded version for convenience. 
.PP
\fBSee also:\fP
.RS 4
\fBsetSelectedColor()\fP 
.RE
.PP

.PP
Definition at line 243 of file kurllabel.cpp.
.PP
References setSelectedColor().
.SS "void KURLLabel::setUseCursor (bool on, \fBQCursor\fP * cursor = \fC0L\fP)\fC [slot]\fP"
.PP
Turns the custom cursor feature on or off. 
.PP
When this is on, the cursor will change to a custom cursor (default is a 'pointing hand') whenever the cursor passes over the label. By default, it is on.
.PP
\fBParameters:\fP
.RS 4
\fIon\fP whether a custom cursor should be displayed. 
.br
\fIcursor\fP is the custom cursor. \fC0L\fP indicates the default 'hand cursor'. 
.RE
.PP

.PP
Definition at line 174 of file kurllabel.cpp.
.SS "void KURLLabel::setGlow (bool glow = \fCtrue\fP)\fC [slot]\fP"
.PP
Turns on or off the 'glow' feature. 
.PP
When this is on, the text will switch to the selected color whenever the mouse passes over it. By default, it is \fCtrue\fP. 
.PP
Definition at line 248 of file kurllabel.cpp.
.SS "void KURLLabel::setFloat (bool do_float = \fCtrue\fP)\fC [slot]\fP"
.PP
Turns on or off the 'float' feature. 
.PP
This feature is very similar to the 'glow' feature in that the color of the label switches to the selected color when the cursor passes over it. In addition, underlining is turned on for as long as the mouse is overhead. Note that if 'glow' and underlining are both already turned on, this feature will have no visible effect. By default, it is \fCfalse\fP. 
.PP
Definition at line 253 of file kurllabel.cpp.
.PP
Referenced by KDialogBase::enableLinkedHelp().
.SS "void KURLLabel::setAltPixmap (const \fBQPixmap\fP & altPix)\fC [slot]\fP"
.PP
Sets the 'alt' pixmap. 
.PP
This pixmap will be displayed when the cursor passes over the label. The effect is similar to the trick done with 'onMouseOver' in javascript.
.PP
\fBSee also:\fP
.RS 4
\fBaltPixmap()\fP 
.RE
.PP

.PP
Definition at line 268 of file kurllabel.cpp.
.SS "void KURLLabel::enteredURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the mouse has passed over the label. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::enteredURL ()\fC [signal]\fP"
.PP
Emitted when the mouse has passed over the label. 
.PP
Referenced by enterEvent().
.SS "void KURLLabel::leftURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the mouse is no longer over the label. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::leftURL ()\fC [signal]\fP"
.PP
Emitted when the mouse is no longer over the label. 
.PP
Referenced by leaveEvent().
.SS "void KURLLabel::leftClickedURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the user clicked the left mouse button on this label. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::leftClickedURL ()\fC [signal]\fP"
.PP
Emitted when the user clicked the left mouse button on this label. 
.PP
Referenced by mouseReleaseEvent().
.SS "void KURLLabel::rightClickedURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the user clicked the right mouse button on this label. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::rightClickedURL ()\fC [signal]\fP"
.PP
Emitted when the user clicked the right mouse button on this label. 
.PP
Referenced by mouseReleaseEvent().
.SS "void KURLLabel::middleClickedURL (const \fBQString\fP & url)\fC [signal]\fP"
.PP
Emitted when the user clicked the middle mouse button on this label. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP The URL for this label. 
.RE
.PP

.SS "void KURLLabel::middleClickedURL ()\fC [signal]\fP"
.PP
Emitted when the user clicked the left mouse button on this label. 
.PP
Referenced by mouseReleaseEvent().
.SS "void KURLLabel::mouseReleaseEvent (\fBQMouseEvent\fP *)\fC [protected, virtual]\fP"
.PP
Overridden for internal reasons; the API remains unaffected. 
.PP
Definition at line 98 of file kurllabel.cpp.
.PP
References leftClickedURL(), middleClickedURL(), and rightClickedURL().
.SS "void KURLLabel::enterEvent (\fBQEvent\fP *)\fC [protected, virtual]\fP"
.PP
Overridden for internal reasons; the API remains unaffected. 
.PP
Definition at line 278 of file kurllabel.cpp.
.PP
References enteredURL(), QLabel::pixmap(), QLabel::setPixmap(), and setUnderline().
.SS "void KURLLabel::leaveEvent (\fBQEvent\fP *)\fC [protected, virtual]\fP"
.PP
Overridden for internal reasons; the API remains unaffected. 
.PP
Definition at line 304 of file kurllabel.cpp.
.PP
References leftURL(), QLabel::pixmap(), QLabel::setPixmap(), and setUnderline().
.SS "bool KURLLabel::event (\fBQEvent\fP * e)\fC [protected, virtual]\fP"
.PP
Catch parent palette changes. 
.PP
Definition at line 320 of file kurllabel.cpp.
.PP
References QPalette::brush(), KGlobalSettings::linkColor(), QPalette::setBrush(), and QPalette::setColor().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
