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

Plasma

meter.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright (C) 2007 Petri Damsten <damu@iki.fi>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU Library General Public License as
00006  *   published by the Free Software Foundation; either version 2, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details
00013  *
00014  *   You should have received a copy of the GNU Library General Public
00015  *   License along with this program; if not, write to the
00016  *   Free Software Foundation, Inc.,
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 
00020 #ifndef PLASMA_METER_H
00021 #define PLASMA_METER_H
00022 
00023 #include <plasma/plasma_export.h>
00024 #include <plasma/dataengine.h>
00025 #include <QtGui/QGraphicsWidget>
00026 
00027 namespace Plasma
00028 {
00029 
00030 class MeterPrivate;
00031 
00054 class PLASMA_EXPORT Meter : public QGraphicsWidget
00055 {
00056     Q_OBJECT
00057     Q_ENUMS(MeterType)
00058     Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
00059     Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
00060     Q_PROPERTY(int value READ value WRITE setValue)
00061     Q_PROPERTY(QString svg READ svg WRITE setSvg)
00062     Q_PROPERTY(MeterType meterType READ meterType WRITE setMeterType)
00063 
00064 public:
00068     enum MeterType {
00070         BarMeterHorizontal,
00072         BarMeterVertical,
00074         AnalogMeter
00075     };
00076 
00082     explicit Meter(QGraphicsItem *parent = 0);
00083 
00087     ~Meter();
00088 
00092     void setMaximum(int maximum);
00093 
00097     int maximum() const;
00098 
00102     void setMinimum(int minimum);
00103 
00107     int minimum() const;
00108 
00112     void setValue(int value);
00113 
00117     int value() const;
00118 
00122     void setSvg(const QString &svg);
00123 
00127     QString svg() const;
00128 
00133     void setMeterType(MeterType type);
00134 
00138     MeterType meterType() const;
00139 
00145     void setLabel(int index, const QString &text);
00146 
00151     QString label(int index) const;
00152 
00158     void setLabelColor(int index, const QColor &color);
00159 
00164     QColor labelColor(int index) const;
00165 
00171     void setLabelFont(int index, const QFont &font);
00172 
00177     QFont labelFont(int index) const;
00178 
00184     void setLabelAlignment(int index, const Qt::Alignment alignment);
00185 
00190     Qt::Alignment labelAlignment(int index) const;
00191 
00196     QRectF labelRect(int index) const;
00197 
00198 public Q_SLOTS:
00202     void dataUpdated(const QString &sourceName, const Plasma::DataEngine::Data &data);
00203 
00204 protected:
00208     virtual void paint(QPainter *p,
00209                        const QStyleOptionGraphicsItem *option,
00210                        QWidget *widget = 0);
00211 
00212 private:
00213     Q_PRIVATE_SLOT(d, void progressChanged(qreal))
00214     MeterPrivate *const d;
00215 };
00216 
00217 } // End of namepace
00218 
00219 #endif

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal