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

libplasma

Plasma::Label

Plasma::Label Class Reference

#include <label.h>

Inheritance diagram for Plasma::Label:

Inheritance graph
[legend]

List of all members.


Detailed Description

Simple Text Label.

Author:
Matias Valdenegro T. <mvaldenegro@informatica.utem.cl>
This class is a simple text label, it just draws plain text.

Definition at line 40 of file label.h.


Public Member Functions

 Label (Widget *parent)
virtual ~Label ()
Qt::Orientations expandingDirections () const
bool hasHeightForWidth () const
qreal heightForWidth (qreal w) const
QSizeF sizeHint () const
void setText (const QString &text)
QString text () const
void setAlignment (Qt::Alignment align)
Qt::Alignment alignment () const
void setPen (const QPen &pen)
QPen pen () const
void setMaximumWidth (int width)
int maximumWidth () const
void setFont (const QFont &font)
QFont font () const
void paintWidget (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)

Properties

QString text
Qt::Alignment alignment
QPen pen
int maximumWidth

Constructor & Destructor Documentation

Plasma::Label::Label ( Widget *  parent  ) 

Constructor.

Definition at line 44 of file label.cpp.

Plasma::Label::~Label (  )  [virtual]

Virtual Destructor.

Definition at line 52 of file label.cpp.


Member Function Documentation

Qt::Orientations Plasma::Label::expandingDirections (  )  const [virtual]

Labels can expand in Horizontal and Vertical directions.

Reimplemented from Plasma::Widget.

Definition at line 57 of file label.cpp.

bool Plasma::Label::hasHeightForWidth (  )  const [virtual]

Labels can use height-for-width geometry management.

Reimplemented from Plasma::Widget.

Definition at line 62 of file label.cpp.

qreal Plasma::Label::heightForWidth ( qreal  w  )  const [virtual]

Reimplemented from Plasma::Widget.

Reimplemented from Plasma::Widget.

Definition at line 67 of file label.cpp.

QSizeF Plasma::Label::sizeHint (  )  const [virtual]

Reimplemented from Plasma::Widget.

Reimplemented from Plasma::Widget.

Definition at line 76 of file label.cpp.

void Plasma::Label::setText ( const QString &  text  ) 

Sets the text to be displayed.

Definition at line 83 of file label.cpp.

QString Plasma::Label::text (  )  const

Returns the displayed text.

void Plasma::Label::setAlignment ( Qt::Alignment  align  ) 

Sets the alignment of the displayed text.

Definition at line 95 of file label.cpp.

Qt::Alignment Plasma::Label::alignment (  )  const

Returns the alignment of the displayed text.

void Plasma::Label::setPen ( const QPen &  pen  ) 

Sets the pen used to paint the text.

Definition at line 105 of file label.cpp.

QPen Plasma::Label::pen (  )  const

Returns the pen used to paint the text.

void Plasma::Label::setMaximumWidth ( int  width  ) 

Sets the maximum width that this label should extend to.

  • width the new maximum width in pixels

Definition at line 117 of file label.cpp.

int Plasma::Label::maximumWidth (  )  const

The width in pixels that this label is constrained to.

void Plasma::Label::setFont ( const QFont &  font  ) 

Sets the font used for the text.

Definition at line 127 of file label.cpp.

QFont Plasma::Label::font (  )  const

Returns the font used for the text.

Reimplemented from Plasma::Widget.

Definition at line 134 of file label.cpp.

void Plasma::Label::paintWidget ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [virtual]

Paint function.

Reimplemented from Plasma::Widget.

Definition at line 139 of file label.cpp.


Property Documentation

QString Plasma::Label::text [read, write]

Definition at line 43 of file label.h.

Qt::Alignment Plasma::Label::alignment [read, write]

Definition at line 44 of file label.h.

QPen Plasma::Label::pen [read, write]

Definition at line 45 of file label.h.

int Plasma::Label::maximumWidth [read, write]

Definition at line 46 of file label.h.


The documentation for this class was generated from the following files:
  • label.h
  • label.cpp

libplasma

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
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