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

Plasma

  • Plasma
  • Meter
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
Plasma::Meter Class Reference

#include <Plasma/Widgets/Meter>

Inheritance diagram for Plasma::Meter:
Inheritance graph
[legend]

Public Types

enum  MeterType { BarMeterHorizontal, BarMeterVertical, AnalogMeter }
 

Public Slots

void dataUpdated (const QString &sourceName, const Plasma::DataEngine::Data &data)
 
void setMaximum (int maximum)
 
void setMinimum (int minimum)
 
void setValue (int value)
 

Signals

void valueChanged (const int &value)
 

Public Member Functions

 Meter (QGraphicsItem *parent=0)
 
 ~Meter ()
 
QString label (int index) const
 
Qt::Alignment labelAlignment (int index) const
 
QColor labelColor (int index) const
 
QFont labelFont (int index) const
 
QRectF labelRect (int index) const
 
int maximum () const
 
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 setMeterType (MeterType type)
 
void setSvg (const QString &svg)
 
QString svg () const
 
int value () const
 

Protected Member Functions

virtual void paint (QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 
QSizeF sizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
 

Properties

int maximum
 
MeterType meterType
 
int minimum
 
QString svg
 
int value
 

Detailed Description

Provides generic meter widget for Plasma.

Analog and bar meters are supported.

Svgs can have following ids:

  • background: Drawn first to the bottom background can be a FrameSvg
  • label0, label1, ...: Rectangles mark the label places
  • bar: Bar for the bar meter can be replaced with bar-active and bar-inactive FrameSvg
  • 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
Author
Petri Damstén

Definition at line 54 of file meter.h.

Member Enumeration Documentation

enum Plasma::Meter::MeterType

Meter types enum.

Enumerator
BarMeterHorizontal 

Horizontal bar meter (like thermometer).

BarMeterVertical 

Vertical bar meter (like thermometer).

AnalogMeter 

Analog meter (like tachometer).

Definition at line 68 of file meter.h.

Constructor & Destructor Documentation

Plasma::Meter::Meter ( QGraphicsItem *  parent = 0)
explicit

Constructor.

Parameters
parentthe QGraphicsItem this meter is parented to.
parentthe QObject this meter is parented to.

Definition at line 269 of file meter.cpp.

Plasma::Meter::~Meter ( )

Destructor.

Definition at line 278 of file meter.cpp.

Member Function Documentation

void Plasma::Meter::dataUpdated ( const QString &  sourceName,
const Plasma::DataEngine::Data &  data 
)
slot

Used when connecting to a DataEngine.

Definition at line 403 of file meter.cpp.

QString Plasma::Meter::label ( int  index) const
Parameters
indexlabel index
Returns
text label for the meter

Definition at line 353 of file meter.cpp.

Qt::Alignment Plasma::Meter::labelAlignment ( int  index) const
Parameters
indexlabel index
Returns
text label alignment for the meter

Definition at line 392 of file meter.cpp.

QColor Plasma::Meter::labelColor ( int  index) const
Parameters
indexlabel index
Returns
text label color for the meter

Definition at line 366 of file meter.cpp.

QFont Plasma::Meter::labelFont ( int  index) const
Parameters
indexlabel index
Returns
text label font for the meter

Definition at line 379 of file meter.cpp.

QRectF Plasma::Meter::labelRect ( int  index) const
Parameters
indexlabel index
Returns
the size of this label.

Definition at line 397 of file meter.cpp.

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 
)
protectedvirtual

Reimplemented from Plasma::Widget.

Definition at line 463 of file meter.cpp.

void Plasma::Meter::setLabel ( int  index,
const QString &  text 
)

Set text label for the meter.

Parameters
indexlabel index.
texttext for the label.

Definition at line 345 of file meter.cpp.

void Plasma::Meter::setLabelAlignment ( int  index,
const Qt::Alignment  alignment 
)

Set text label alignment for the meter.

Parameters
indexlabel index
alignmentthe text alignment to apply to the label

Definition at line 384 of file meter.cpp.

void Plasma::Meter::setLabelColor ( int  index,
const QColor &  color 
)

Set text label color for the meter.

Parameters
indexlabel index
colorthe color to apply to the label

Definition at line 358 of file meter.cpp.

void Plasma::Meter::setLabelFont ( int  index,
const QFont &  font 
)

Set text label font for the meter.

Parameters
indexlabel index
fontthe font to apply to the label

Definition at line 371 of file meter.cpp.

void Plasma::Meter::setMaximum ( int  maximum)
slot

Set maximum value for the meter.

Definition at line 284 of file meter.cpp.

void Plasma::Meter::setMeterType ( MeterType  type)

Set meter type.

Note: setSvg gets called automatically with the proper default values if svg is not set.

Definition at line 443 of file meter.cpp.

void Plasma::Meter::setMinimum ( int  minimum)
slot

Set minimum value for the meter.

Definition at line 294 of file meter.cpp.

void Plasma::Meter::setSvg ( const QString &  svg)

Set svg file name.

Definition at line 418 of file meter.cpp.

void Plasma::Meter::setValue ( int  value)
slot

Set value for the meter.

Definition at line 309 of file meter.cpp.

QSizeF Plasma::Meter::sizeHint ( Qt::SizeHint  which,
const QSizeF &  constraint = QSizeF() 
) const
protected

Definition at line 553 of file meter.cpp.

QString Plasma::Meter::svg ( ) const
Returns
svg file name
int Plasma::Meter::value ( ) const
Returns
value for the meter
void Plasma::Meter::valueChanged ( const int &  value)
signal

This signal is sent when the value of the meter changes programmatically.

The meter's value is passed.

Property Documentation

int Plasma::Meter::maximum
readwrite

Definition at line 59 of file meter.h.

Meter::MeterType Plasma::Meter::meterType
readwrite

Definition at line 62 of file meter.h.

int Plasma::Meter::minimum
readwrite

Definition at line 58 of file meter.h.

QString Plasma::Meter::svg
readwrite

Definition at line 61 of file meter.h.

int Plasma::Meter::value
readwrite

Definition at line 60 of file meter.h.


The documentation for this class was generated from the following files:
  • meter.h
  • meter.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 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 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