• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
kurllabel.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 1998 Kurt Granroth <granroth@kde.org>
3 Copyright (C) 2000 Peter Putzer <putzer@kde.org>
4 Copyright (C) 2005 Jarosław Staniek <staniek@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KURLLABEL_H
22#define KURLLABEL_H
23
24#include <kdeui_export.h>
25
26#include <QtGui/QColor>
27#include <QtGui/QLabel>
28#include <QtGui/QPixmap>
29
30class QCursor;
31
69class KDEUI_EXPORT KUrlLabel : public QLabel
70{
71 Q_OBJECT
72 Q_PROPERTY(QString url READ url WRITE setUrl)
73 Q_PROPERTY(QString tipText READ tipText WRITE setTipText )
74 Q_PROPERTY(QPixmap alternatePixmap READ alternatePixmap WRITE setAlternatePixmap )
75 Q_PROPERTY(bool glowEnabled READ isGlowEnabled WRITE setGlowEnabled )
76 Q_PROPERTY(bool floatEnabled READ isFloatEnabled WRITE setFloatEnabled )
77 Q_PROPERTY(bool useTips READ useTips WRITE setUseTips )
78 Q_PROPERTY(bool useCursor READ useCursor WRITE setUseCursor )
79
80 public:
87 explicit KUrlLabel( QWidget* parent = 0L );
88
100 explicit KUrlLabel( const QString& url, const QString& text = QString(),
101 QWidget* parent = 0L );
102
106 virtual ~KUrlLabel();
107
111 QString url() const;
112
116 QString tipText() const;
117
123 bool useTips() const;
124
130 bool useCursor() const;
131
136 bool isGlowEnabled() const;
137
146 bool isFloatEnabled() const;
147
151 const QPixmap* alternatePixmap() const;
152
153 public Q_SLOTS:
160 void setUnderline( bool on = true );
161
167 void setUrl( const QString& url );
168
172 virtual void setFont( const QFont &font );
173
181 void setUseTips ( bool on = true );
182
190 void setTipText( const QString& tip );
191
198 void setHighlightedColor( const QColor& highcolor );
199
205 void setHighlightedColor( const QString& highcolor );
206
214 void setSelectedColor( const QColor& color );
215
221 void setSelectedColor( const QString& color );
222
233 void setUseCursor( bool on, QCursor* cursor = 0L );
234
242 void setGlowEnabled( bool glow = true );
243
255 void setFloatEnabled( bool do_float = true );
256
266 void setAlternatePixmap( const QPixmap& pixmap );
267
268 Q_SIGNALS:
269
275 void enteredUrl( const QString& url );
276
280 void enteredUrl();
281
287 void leftUrl( const QString& url );
288
292 void leftUrl();
293
299 void leftClickedUrl( const QString& url );
300
304 void leftClickedUrl();
305
311 void rightClickedUrl( const QString& url );
312
316 void rightClickedUrl();
317
323 void middleClickedUrl( const QString& url );
324
328 void middleClickedUrl();
329
330 protected:
334 virtual void mouseReleaseEvent( QMouseEvent* );
335
339 virtual void enterEvent( QEvent* );
340
344 virtual void leaveEvent( QEvent* );
345
349 virtual bool event( QEvent* );
350
351 private:
352 class Private;
353 Private* const d;
354
355 Q_PRIVATE_SLOT( d, void updateColor() )
356};
357
358#endif
KUrlLabel::enterEvent
virtual void enterEvent(QEvent *)
Overridden for internal reasons; the API remains unaffected.
Definition kurllabel.cpp:272
KUrlLabel::setUnderline
void setUnderline(bool on=true)
Turns on or off the underlining.
Definition kurllabel.cpp:147
KUrlLabel::event
virtual bool event(QEvent *)
Catch parent palette changes.
Definition kurllabel.cpp:312
KUrlLabel::setUrl
void setUrl(const QString &url)
Sets the URL for this label to url.
Definition kurllabel.cpp:154
KUrlLabel::setFloatEnabled
void setFloatEnabled(bool do_float=true)
Turns on or off the "float" feature.
Definition kurllabel.cpp:247
KUrlLabel::isFloatEnabled
bool isFloatEnabled() const
This feature is very similar to the "glow" feature in that the color of the label switches to the sel...
Definition kurllabel.cpp:257
KUrlLabel::setFont
virtual void setFont(const QFont &font)
Overridden for internal reasons; the API remains unaffected.
Definition kurllabel.cpp:139
KUrlLabel::useCursor
bool useCursor
Definition kurllabel.h:78
KUrlLabel::floatEnabled
bool floatEnabled
Definition kurllabel.h:76
KUrlLabel::isGlowEnabled
bool isGlowEnabled() const
When this is on, the text will switch to the selected color whenever the mouse passes over it.
Definition kurllabel.cpp:252
KUrlLabel::useTips
bool useTips
Definition kurllabel.h:77
KUrlLabel::KUrlLabel
KUrlLabel(QWidget *parent=0L)
Default constructor.
Definition kurllabel.cpp:97
KUrlLabel::rightClickedUrl
void rightClickedUrl(const QString &url)
Emitted when the user clicked the right mouse button on this label.
KUrlLabel::setUseTips
void setUseTips(bool on=true)
Turns on or off the tool tip feature.
Definition kurllabel.cpp:189
KUrlLabel::alternatePixmap
QPixmap alternatePixmap
Definition kurllabel.h:74
KUrlLabel::leftClickedUrl
void leftClickedUrl(const QString &url)
Emitted when the user clicked the left mouse button on this label.
KUrlLabel::setTipText
void setTipText(const QString &tip)
Specifies what text to display when tooltips are turned on.
Definition kurllabel.cpp:199
KUrlLabel::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *)
Overridden for internal reasons; the API remains unaffected.
Definition kurllabel.cpp:111
KUrlLabel::setAlternatePixmap
void setAlternatePixmap(const QPixmap &pixmap)
Sets the "alt" pixmap.
Definition kurllabel.cpp:262
KUrlLabel::setGlowEnabled
void setGlowEnabled(bool glow=true)
Turns on or off the "glow" feature.
Definition kurllabel.cpp:242
KUrlLabel::leaveEvent
virtual void leaveEvent(QEvent *)
Overridden for internal reasons; the API remains unaffected.
Definition kurllabel.cpp:296
KUrlLabel::tipText
QString tipText
Definition kurllabel.h:73
KUrlLabel::setSelectedColor
void setSelectedColor(const QColor &color)
Sets the selected color.
Definition kurllabel.cpp:229
KUrlLabel::glowEnabled
bool glowEnabled
Definition kurllabel.h:75
KUrlLabel::leftUrl
void leftUrl(const QString &url)
Emitted when the mouse is no longer over the label.
KUrlLabel::middleClickedUrl
void middleClickedUrl(const QString &url)
Emitted when the user clicked the middle mouse button on this label.
KUrlLabel::url
QString url
Definition kurllabel.h:72
KUrlLabel::enteredUrl
void enteredUrl(const QString &url)
Emitted when the mouse has passed over the label.
KUrlLabel::setHighlightedColor
void setHighlightedColor(const QColor &highcolor)
Sets the highlight color.
Definition kurllabel.cpp:216
KUrlLabel::setUseCursor
void setUseCursor(bool on, QCursor *cursor=0L)
Turns the custom cursor feature on or off.
Definition kurllabel.cpp:169
QCursor
QLabel
QWidget
kdeui_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal