libplasma
Plasma::Meter Class Reference
#include <meter.h>
Inheritance diagram for Plasma::Meter:

Detailed Description
This class provides generic meter widget for the Plasma desktop.Analog and bar meters are supported.
Svgs can have following ids:
- background: Drawn first to the bottom
- label0, label1, ...: Rectangles mark the label places
- bar: Bar for the bar meter
- pointer: Pointer for analog meter
- rotatecenter: Marks the place of pointer rotation center
- rotateminmax: Width and height of this object are the Min and Max rotate angles for the pointer
- foreground: Is drawn to top
Definition at line 50 of file meter.h.
Public Types | |
enum | MeterType { BarMeterHorizontal, BarMeterVertical, AnalogMeter } |
Public Slots | |
void | dataUpdated (const QString &sourceName, const Plasma::DataEngine::Data &data) |
Public Member Functions | |
QString | label (int index) const |
Qt::Alignment | labelAlignment (int index) const |
QColor | labelColor (int index) const |
QFont | labelFont (int index) const |
int | maximum () const |
Meter (QGraphicsItem *parent=0) | |
MeterType | meterType () const |
int | minimum () const |
void | setLabel (int index, const QString &text) |
void | setLabelAlignment (int index, const Qt::Alignment alignment) |
void | setLabelColor (int index, const QColor &color) |
void | setLabelFont (int index, const QFont &font) |
void | setMaximum (int maximum) |
void | setMeterType (MeterType type) |
void | setMinimum (int minimum) |
void | setSvg (const QString &svg) |
void | setValue (int value) |
QString | svg () const |
int | value () const |
~Meter () | |
Protected Member Functions | |
virtual void | paint (QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
Properties | |
int | maximum |
MeterType | meterType |
int | minimum |
QString | svg |
int | value |
Member Enumeration Documentation
Constructor & Destructor Documentation
Plasma::Meter::Meter | ( | QGraphicsItem * | parent = 0 |
) | [explicit] |
Constructor.
- Parameters:
-
parent the QGraphicsItem this meter is parented to. parent the QObject this meter is parented to.
Member Function Documentation
void Plasma::Meter::dataUpdated | ( | const QString & | sourceName, | |
const Plasma::DataEngine::Data & | data | |||
) | [slot] |
QString Plasma::Meter::label | ( | int | index | ) | const |
Qt::Alignment Plasma::Meter::labelAlignment | ( | int | index | ) | const |
QColor Plasma::Meter::labelColor | ( | int | index | ) | const |
QFont Plasma::Meter::labelFont | ( | int | index | ) | const |
int Plasma::Meter::maximum | ( | ) | const |
- Returns:
- maximum value for the meter
MeterType Plasma::Meter::meterType | ( | ) | const |
- Returns:
- meter type
int Plasma::Meter::minimum | ( | ) | const |
- Returns:
- minimum value for the meter
void Plasma::Meter::paint | ( | QPainter * | p, | |
const QStyleOptionGraphicsItem * | option, | |||
QWidget * | widget = 0 | |||
) | [protected, virtual] |
void Plasma::Meter::setLabel | ( | int | index, | |
const QString & | text | |||
) |
void Plasma::Meter::setLabelAlignment | ( | int | index, | |
const Qt::Alignment | alignment | |||
) |
void Plasma::Meter::setLabelColor | ( | int | index, | |
const QColor & | color | |||
) |
void Plasma::Meter::setLabelFont | ( | int | index, | |
const QFont & | font | |||
) |
void Plasma::Meter::setMaximum | ( | int | maximum | ) |
void Plasma::Meter::setMeterType | ( | MeterType | type | ) |
void Plasma::Meter::setMinimum | ( | int | minimum | ) |
void Plasma::Meter::setSvg | ( | const QString & | svg | ) |
void Plasma::Meter::setValue | ( | int | value | ) |
QString Plasma::Meter::svg | ( | ) | const |
- Returns:
- svg file name
int Plasma::Meter::value | ( | ) | const |
- Returns:
- value for the meter
Property Documentation
Meter::MeterType Plasma::Meter::meterType [read, write] |
The documentation for this class was generated from the following files: