• 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
A drop-in replacement for QLabel that displays hyperlinks.
Definition: kurllabel.h:70
KUrlLabel::rightClickedUrl
void rightClickedUrl()
Emitted when the user clicked the right mouse button on this label.
KUrlLabel::enteredUrl
void enteredUrl()
Emitted when the mouse has passed over the label.
KUrlLabel::rightClickedUrl
void rightClickedUrl(const QString &url)
Emitted when the user clicked the right mouse button on this label.
KUrlLabel::leftClickedUrl
void leftClickedUrl(const QString &url)
Emitted when the user clicked the left mouse button on this label.
KUrlLabel::middleClickedUrl
void middleClickedUrl()
Emitted when the user clicked the left mouse button on this label.
KUrlLabel::leftClickedUrl
void leftClickedUrl()
Emitted when the user clicked the left mouse button on this label.
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::enteredUrl
void enteredUrl(const QString &url)
Emitted when the mouse has passed over the label.
KUrlLabel::leftUrl
void leftUrl()
Emitted when the mouse is no longer over the label.
QCursor
QLabel
QWidget
kdeui_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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
  • Modules
  • 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