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

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • kdeui
  • widgets
kled.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 1998 Jörg Habenicht (j.habenicht@europemail.com)
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef KLED_H
21 #define KLED_H
22 
23 #include <kdeui_export.h>
24 
25 #include <QtGui/QWidget>
26 
27 class QColor;
28 
44 class KDEUI_EXPORT KLed : public QWidget
45 {
46  Q_OBJECT
47  Q_ENUMS( State Shape Look )
48  Q_PROPERTY( State state READ state WRITE setState )
49  Q_PROPERTY( Shape shape READ shape WRITE setShape )
50  Q_PROPERTY( Look look READ look WRITE setLook )
51  Q_PROPERTY( QColor color READ color WRITE setColor )
52  Q_PROPERTY( int darkFactor READ darkFactor WRITE setDarkFactor )
53 
54  public:
55 
60  enum State { Off, On };
61 
66  enum Shape { Rectangular, Circular };
67 
88  enum Look { Flat, Raised, Sunken };
89 
96  explicit KLed( QWidget *parent = 0 );
97 
106  explicit KLed( const QColor &color, QWidget *parent = 0 );
107 
120  KLed( const QColor& color, KLed::State state, KLed::Look look, KLed::Shape shape,
121  QWidget *parent = 0 );
122 
127  ~KLed();
128 
135  QColor color() const;
136 
143  State state() const;
144 
151  Look look() const;
152 
159  Shape shape() const;
160 
167  int darkFactor() const;
168 
184  void setColor( const QColor& color );
185 
195  void setState( State state );
196 
210  void setLook( Look look );
211 
218  void setShape( Shape shape );
219 
233  void setDarkFactor( int darkFactor );
234 
235  virtual QSize sizeHint() const;
236  virtual QSize minimumSizeHint() const;
237 
238  public Q_SLOTS:
239 
245  void toggle();
246 
253  void on();
254 
261  void off();
262 
263  protected:
267  virtual int ledWidth() const;
268 
272  virtual void paintFlat();
273 
277  virtual void paintRaised();
278 
282  virtual void paintSunken();
283 
287  virtual void paintRect();
288 
293  virtual void paintRectFrame( bool raised );
294 
295  void paintEvent( QPaintEvent* );
296  void resizeEvent( QResizeEvent* );
297 
302  bool paintCachedPixmap();
303 
308  void updateCachedPixmap();
309 
313  void paintLed(Shape shape, Look look);
314 
315  private:
316  class Private;
317  Private * const d;
318 };
319 
320 #endif
QColor
KLed
An LED widget.
Definition: kled.h:44
QWidget
KLed::Look
Look
Displays a flat, round or sunken LED.
Definition: kled.h:88
KLed::State
State
Status of the light is on/off.
Definition: kled.h:60
kdeui_export.h
QSize
KLed::Shape
Shape
Shades of the lamp.
Definition: kled.h:66
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:14 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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