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

Plasma

  • plasma
  • widgets
flashinglabel.h
Go to the documentation of this file.
1/*
2 * Copyright 2007 by André Duffeck <duffeck@kde.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8
9 *
10 * This program 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
13 * GNU General Public License for more details
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef PLASMA_FLASHINGLABEL_H
22#define PLASMA_FLASHINGLABEL_H
23
24#include <QtGui/QGraphicsWidget>
25#include <QtGui/QTextOption>
26
27#include <plasma/plasma_export.h>
28
29namespace Plasma
30{
31
32class FlashingLabelPrivate;
33
39class PLASMA_EXPORT FlashingLabel : public QGraphicsWidget
40{
41 Q_OBJECT
42 Q_PROPERTY(bool autohide READ autohide WRITE setAutohide)
43 Q_PROPERTY(QFont font READ font WRITE setFont)
44 Q_PROPERTY(QColor color READ color WRITE setColor)
45 Q_PROPERTY(int duration READ duration WRITE setDuration)
46
47public:
48 explicit FlashingLabel(QGraphicsItem *parent = 0);
49 virtual ~FlashingLabel();
50
51 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
52
53 QFont font() const;
54 void setFont(const QFont &);
55
56 QColor color() const;
57 void setColor(const QColor &);
58
59 int duration() const;
60 void setDuration(int duration);
61
62 Q_INVOKABLE void flash(const QString &text, int duration = 0,
63 const QTextOption &option = QTextOption(Qt::AlignCenter));
64 Q_INVOKABLE void flash(const QPixmap &pixmap, int duration = 0,
65 Qt::Alignment align = Qt::AlignCenter);
66
67 void setAutohide(bool autohide);
68 bool autohide() const;
69
70protected:
71 QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
72
73public Q_SLOTS:
74 void kill();
75
76protected Q_SLOTS:
77 void fadeIn();
78 void fadeOut();
79
80private:
81 Q_PRIVATE_SLOT(d, void elementAnimationFinished())
82 Q_PRIVATE_SLOT(d, void setPalette())
83 FlashingLabelPrivate *const d;
84};
85
86}
87
88#endif
Plasma::FlashingLabel
Provides flashing text or icons inside Plasma.
Definition: flashinglabel.h:40
QGraphicsWidget
QStyleOptionGraphicsItem
QWidget
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_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.

Plasma

Skip menu "Plasma"
  • 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