#include <Plasma/Widgets/Label>
Provides a plasma-themed QLabel.
Definition at line 40 of file label.h.
◆ Label()
Constructs a label with word wrap on by default.
- Parameters
-
parent | the parent of this widget |
Definition at line 94 of file label.cpp.
◆ ~Label()
Plasma::Label::~Label |
( |
| ) |
|
◆ alignment()
Qt::Alignment Plasma::Label::alignment |
( |
| ) |
const |
- Returns
- the alignment for the text used in the labels
Definition at line 193 of file label.cpp.
◆ changeEvent()
void Plasma::Label::changeEvent |
( |
QEvent * |
event | ) |
|
|
protected |
◆ contextMenuEvent()
void Plasma::Label::contextMenuEvent |
( |
QGraphicsSceneContextMenuEvent * |
event | ) |
|
|
protected |
◆ dataUpdated
◆ event()
bool Plasma::Label::event |
( |
QEvent * |
event | ) |
|
|
protected |
◆ hasScaledContents()
bool Plasma::Label::hasScaledContents |
( |
| ) |
const |
- Returns
- true if the contents are scaled to the label size
Definition at line 167 of file label.cpp.
◆ image()
QString Plasma::Label::image |
( |
| ) |
const |
- Returns
- the image path being displayed currently, or an empty string if none.
Definition at line 157 of file label.cpp.
◆ itemChange()
QVariant Plasma::Label::itemChange |
( |
GraphicsItemChange |
change, |
|
|
const QVariant & |
value |
|
) |
| |
|
protected |
◆ linkActivated
void Plasma::Label::linkActivated |
( |
const QString & |
link | ) |
|
|
signal |
◆ linkHovered
void Plasma::Label::linkHovered |
( |
const QString & |
link | ) |
|
|
signal |
◆ mouseMoveEvent()
void Plasma::Label::mouseMoveEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
◆ mousePressEvent()
void Plasma::Label::mousePressEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
◆ nativeWidget()
QLabel * Plasma::Label::nativeWidget |
( |
| ) |
const |
- Returns
- the native widget wrapped by this Label
Definition at line 218 of file label.cpp.
◆ paint()
◆ resizeEvent()
void Plasma::Label::resizeEvent |
( |
QGraphicsSceneResizeEvent * |
event | ) |
|
|
protected |
◆ setAlignment()
void Plasma::Label::setAlignment |
( |
Qt::Alignment |
alignment | ) |
|
Sets the alignment for the text.
- Parameters
-
Definition at line 188 of file label.cpp.
◆ setImage()
void Plasma::Label::setImage |
( |
const QString & |
path | ) |
|
Sets the path to an image to display.
- Parameters
-
path | the path to the image; if a relative path, then a themed image will be loaded. |
Definition at line 129 of file label.cpp.
◆ setScaledContents()
void Plasma::Label::setScaledContents |
( |
bool |
scaled | ) |
|
Scale or not the contents of the label to the label size.
- Parameters
-
Definition at line 162 of file label.cpp.
◆ setStyleSheet()
void Plasma::Label::setStyleSheet |
( |
const QString & |
stylesheet | ) |
|
Sets the stylesheet used to control the visual display of this Label.
- Parameters
-
Definition at line 208 of file label.cpp.
◆ setText()
void Plasma::Label::setText |
( |
const QString & |
text | ) |
|
Sets the display text for this Label.
- Parameters
-
text | the text to display; should be translated. |
Definition at line 117 of file label.cpp.
◆ setTextSelectable()
void Plasma::Label::setTextSelectable |
( |
bool |
enable | ) |
|
Set if the text on the label can be selected with the mouse.
- Parameters
-
enable | true if we want to manage text selection with the mouse |
- Since
- 4.4
Definition at line 172 of file label.cpp.
◆ setWordWrap()
void Plasma::Label::setWordWrap |
( |
bool |
wrap | ) |
|
Sets if the text of the label can wrap in multiple lines.
- Parameters
-
wrap | multiple lines or not |
- Since
- 4.5
Definition at line 198 of file label.cpp.
◆ sizeHint()
QSizeF Plasma::Label::sizeHint |
( |
Qt::SizeHint |
which, |
|
|
const QSizeF & |
constraint |
|
) |
| const |
|
protected |
◆ styleSheet()
QString Plasma::Label::styleSheet |
( |
| ) |
|
- Returns
- the stylesheet currently used with this widget
◆ text()
QString Plasma::Label::text |
( |
| ) |
const |
- Returns
- the display text
Definition at line 124 of file label.cpp.
◆ textSelectable()
bool Plasma::Label::textSelectable |
( |
| ) |
const |
- Returns
- true if the text is selectable with the mouse
- Since
- 4.4
Definition at line 183 of file label.cpp.
◆ wordWrap()
bool Plasma::Label::wordWrap |
( |
| ) |
const |
- Returns
- true if the label text can wrap in multiple lines if too long
- Since
- 4.5
Definition at line 203 of file label.cpp.
◆ alignment
Qt::Alignment Plasma::Label::alignment |
|
readwrite |
◆ hasScaledContents
bool Plasma::Label::hasScaledContents |
|
readwrite |
◆ image
QString Plasma::Label::image |
|
readwrite |
◆ nativeWidget
QLabel * Plasma::Label::nativeWidget |
|
read |
◆ parentWidget
◆ styleSheet
QString Plasma::Label::styleSheet |
|
readwrite |
◆ text
QString Plasma::Label::text |
|
readwrite |
◆ textSelectable
bool Plasma::Label::textSelectable |
|
readwrite |
◆ wordWrap
bool Plasma::Label::wordWrap |
|
readwrite |
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by
doxygen 1.9.6 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.