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

Plasma

  • Plasma
  • Label
Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties

Plasma::Label Class Reference

Provides a plasma-themed QLabel. More...

#include <Plasma/Widgets/Label>

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

List of all members.

Public Slots

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

Signals

void linkActivated (const QString &link)
void linkHovered (const QString &link)

Public Member Functions

 Label (QGraphicsWidget *parent=0)
 ~Label ()
Qt::Alignment alignment () const
bool hasScaledContents () const
QString image () const
QLabel * nativeWidget () const
void setAlignment (Qt::Alignment alignment)
void setImage (const QString &path)
void setScaledContents (bool scaled)
void setStyleSheet (const QString &stylesheet)
void setText (const QString &text)
void setTextSelectable (bool enable)
void setWordWrap (bool wrap)
QString styleSheet ()
QString text () const
bool textSelectable () const
bool wordWrap () const

Protected Member Functions

void changeEvent (QEvent *event)
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
bool event (QEvent *event)
QVariant itemChange (GraphicsItemChange change, const QVariant &value)
void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
void mousePressEvent (QGraphicsSceneMouseEvent *event)
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void resizeEvent (QGraphicsSceneResizeEvent *event)
QSizeF sizeHint (Qt::SizeHint which, const QSizeF &constraint) const

Properties

Qt::Alignment alignment
bool hasScaledContents
QString image
QLabel nativeWidget
QGraphicsWidget parentWidget
QString styleSheet
QString text
bool textSelectable
bool wordWrap

Detailed Description

Provides a plasma-themed QLabel.

Definition at line 40 of file label.h.


Constructor & Destructor Documentation

Plasma::Label::Label ( QGraphicsWidget *  parent = 0) [explicit]

Constructs a label with word wrap on by default.

  • parent the parent of this widget

Definition at line 92 of file label.cpp.

Plasma::Label::~Label ( )

Definition at line 108 of file label.cpp.


Member Function Documentation

Qt::Alignment Plasma::Label::alignment ( ) const
Returns:
the alignment for the text used in the labels
void Plasma::Label::changeEvent ( QEvent *  event) [protected]

Definition at line 313 of file label.cpp.

void Plasma::Label::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event) [protected]

Definition at line 232 of file label.cpp.

void Plasma::Label::dataUpdated ( const QString &  sourceName,
const Plasma::DataEngine::Data &  data 
) [slot]

Definition at line 218 of file label.cpp.

bool Plasma::Label::event ( QEvent *  event) [protected]

Definition at line 319 of file label.cpp.

bool Plasma::Label::hasScaledContents ( ) const
Returns:
true if the contents are scaled to the label size
QString Plasma::Label::image ( ) const
Returns:
the image path being displayed currently, or an empty string if none.
QVariant Plasma::Label::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
) [protected]

Definition at line 325 of file label.cpp.

void Plasma::Label::linkActivated ( const QString &  link) [signal]
void Plasma::Label::linkHovered ( const QString &  link) [signal]
void Plasma::Label::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event) [protected]

Definition at line 259 of file label.cpp.

void Plasma::Label::mousePressEvent ( QGraphicsSceneMouseEvent *  event) [protected]

Definition at line 249 of file label.cpp.

QLabel* Plasma::Label::nativeWidget ( ) const
Returns:
the native widget wrapped by this Label
void Plasma::Label::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [protected]

Definition at line 266 of file label.cpp.

void Plasma::Label::resizeEvent ( QGraphicsSceneResizeEvent *  event) [protected]

Definition at line 243 of file label.cpp.

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

Sets the alignment for the text.

  • the desired alignment

Definition at line 183 of file label.cpp.

void Plasma::Label::setImage ( const QString &  path)

Sets the path to an image to display.

  • path the path to the image; if a relative path, then a themed image will be loaded.

Definition at line 124 of file label.cpp.

void Plasma::Label::setScaledContents ( bool  scaled)

Scale or not the contents of the label to the label size.

  • scale

Definition at line 157 of file label.cpp.

void Plasma::Label::setStyleSheet ( const QString &  stylesheet)

Sets the stylesheet used to control the visual display of this Label.

  • stylesheet a CSS string

Definition at line 203 of file label.cpp.

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

Sets the display text for this Label.

  • text the text to display; should be translated.

Definition at line 113 of file label.cpp.

void Plasma::Label::setTextSelectable ( bool  enable)

Set if the text on the label can be selected with the mouse.

  • enable true if we want to manage text selection with the mouse
    Since:
    4.4

Definition at line 167 of file label.cpp.

void Plasma::Label::setWordWrap ( bool  wrap)

Sets if the text of the label can wrap in multiple lines.

  • wrap multiple lines or not
    Since:
    4.5

Definition at line 193 of file label.cpp.

QSizeF Plasma::Label::sizeHint ( Qt::SizeHint  which,
const QSizeF &  constraint 
) const [protected]

Definition at line 334 of file label.cpp.

QString Plasma::Label::styleSheet ( )
Returns:
the stylesheet currently used with this widget
QString Plasma::Label::text ( ) const
Returns:
the display text
bool Plasma::Label::textSelectable ( ) const
Returns:
true if the text is selectable with the mouse
Since:
4.4
bool Plasma::Label::wordWrap ( ) const
Returns:
true if the label text can wrap in multiple lines if too long
Since:
4.5

Property Documentation

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

Definition at line 47 of file label.h.

bool Plasma::Label::hasScaledContents [read, write]

Definition at line 48 of file label.h.

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

Definition at line 46 of file label.h.

QLabel * Plasma::Label::nativeWidget [read]

Definition at line 52 of file label.h.

QGraphicsWidget Plasma::Label::parentWidget [read]

Definition at line 44 of file label.h.

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

Definition at line 51 of file label.h.

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

Definition at line 45 of file label.h.

bool Plasma::Label::textSelectable [read, write]

Definition at line 49 of file label.h.

bool Plasma::Label::wordWrap [read, write]

Definition at line 50 of file label.h.


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

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
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
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