Plasma
#include <iconwidget.h>
Definition at line 56 of file iconwidget.h.
◆ IconWidget() [1/3]
IconWidget::IconWidget |
( |
QGraphicsItem * |
parent = 0 | ) |
|
|
explicit |
◆ IconWidget() [2/3]
IconWidget::IconWidget |
( |
const QString & |
text, |
|
|
QGraphicsItem * |
parent = 0 |
|
) |
| |
|
explicit |
Convenience constructor to create a Plasma::IconWidget with text.
- Parameters
-
text | the text that will be displayed with this icon. |
parent | the QGraphicsItem this icon is parented to. |
Definition at line 358 of file iconwidget.cpp.
◆ IconWidget() [3/3]
IconWidget::IconWidget |
( |
const QIcon & |
icon, |
|
|
const QString & |
text, |
|
|
QGraphicsItem * |
parent = 0 |
|
) |
| |
Creates a new Plasma::IconWidget with text and an icon.
- Parameters
-
icon | the icon that will be displayed with this icon. |
text | the text that will be displayed with this icon. |
parent | The QGraphicsItem this icon is parented to. |
Definition at line 366 of file iconwidget.cpp.
◆ ~IconWidget()
IconWidget::~IconWidget |
( |
| ) |
|
|
virtual |
◆ action()
QAction * IconWidget::action |
( |
| ) |
const |
- Returns
- the currently associated action, if any.
Definition at line 463 of file iconwidget.cpp.
◆ activated
void Plasma::IconWidget::activated |
( |
| ) |
|
|
signal |
Indicates when the icon has been activated following the single or doubleclick settings.
◆ addIconAction()
void IconWidget::addIconAction |
( |
QAction * |
action | ) |
|
Plasma::IconWidget allows the user to specify a number of actions (currently four) to be displayed around the widget.
This method allows for a created QAction to be added to the Plasma::IconWidget.
- Parameters
-
action | the QAction to associate with this icon. |
Definition at line 415 of file iconwidget.cpp.
◆ changed
void Plasma::IconWidget::changed |
( |
| ) |
|
|
signal |
Indicates that something about the icon may have changed (image, text, etc) only actually works for icons associated with an action.
◆ changeEvent()
void IconWidget::changeEvent |
( |
QEvent * |
event | ) |
|
|
protected |
◆ clicked
void Plasma::IconWidget::clicked |
( |
| ) |
|
|
signal |
Indicates when the icon has been clicked.
◆ doubleClicked
void Plasma::IconWidget::doubleClicked |
( |
| ) |
|
|
signal |
Indicates when the icon has been double-clicked.
◆ drawActionButtonBase()
void IconWidget::drawActionButtonBase |
( |
QPainter * |
painter, |
|
|
const QSize & |
size, |
|
|
int |
element |
|
) |
| |
◆ drawBackground()
bool IconWidget::drawBackground |
( |
| ) |
const |
- Returns
- true if a background area is to be drawn for the icon
Definition at line 510 of file iconwidget.cpp.
◆ hoverEnterEvent()
void IconWidget::hoverEnterEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
protected |
◆ hoverLeaveEvent()
void IconWidget::hoverLeaveEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
protected |
◆ icon()
QIcon IconWidget::icon |
( |
| ) |
const |
- Returns
- the icon associated with this icon.
Definition at line 1309 of file iconwidget.cpp.
◆ iconSize()
QSizeF IconWidget::iconSize |
( |
| ) |
const |
◆ infoText()
QString IconWidget::infoText |
( |
| ) |
const |
Returns the meta text associated with this icon.
Definition at line 1304 of file iconwidget.cpp.
◆ invertedLayout()
bool IconWidget::invertedLayout |
( |
| ) |
const |
- Returns
- if the layout of the icons should appear inverted or not
Definition at line 1566 of file iconwidget.cpp.
◆ invertLayout()
void IconWidget::invertLayout |
( |
bool |
invert | ) |
|
inverts the layout of the icons if the orientation is horizontal, normally we get icon on the left with left-to-right languages
- Parameters
-
invert | if we want to invert the layout of icons |
Definition at line 1561 of file iconwidget.cpp.
◆ isDown()
bool IconWidget::isDown |
( |
| ) |
|
|
protected |
◆ maximumIconSize()
QSizeF IconWidget::maximumIconSize |
( |
| ) |
const |
- Returns
- The size that should be the maximum beyond the icon shouldn't scale when the icon will be when positioned in a layout. The default is QSizeF(-1, -1); an invalid size means the icon will attempt to be at its default and "optimal" size
- Since
- 4.5
Definition at line 1376 of file iconwidget.cpp.
◆ minimumIconSize()
QSizeF IconWidget::minimumIconSize |
( |
| ) |
const |
- Returns
- The size that should be the minimum beyond the icon shouldn't scale when the icon will be when positioned in a layout. The default is QSizeF(-1, -1); an invalid size means the icon will attempt to be at its default and "optimal" size
- Since
- 4.5
Definition at line 1365 of file iconwidget.cpp.
◆ mouseDoubleClickEvent()
void IconWidget::mouseDoubleClickEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
◆ mouseMoveEvent()
void IconWidget::mouseMoveEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
◆ mousePressEvent()
void IconWidget::mousePressEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
◆ mouseReleaseEvent()
void IconWidget::mouseReleaseEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
◆ numDisplayLines()
int Plasma::IconWidget::numDisplayLines |
( |
| ) |
|
- Returns
- the number of lines allowed to display
◆ orientation()
Qt::Orientation IconWidget::orientation |
( |
| ) |
const |
◆ paint()
◆ preferredIconSize()
QSizeF IconWidget::preferredIconSize |
( |
| ) |
const |
- Returns
- The size you prefer the icon will be when positioned in a layout. The default is QSizeF(-1, -1); an invalid size means the icon will attempt to be at its default and "optimal" size
- Since
- 4.5
Definition at line 1354 of file iconwidget.cpp.
◆ pressed
void Plasma::IconWidget::pressed |
( |
bool |
down | ) |
|
|
signal |
Indicates when the icon has been pressed.
◆ removeIconAction()
void IconWidget::removeIconAction |
( |
QAction * |
action | ) |
|
Removes a previously set iconAction.
The action will be removed from the widget but will not be deleted.
- Parameters
-
the | QAction to be removed, if 0 all actions will be removed |
Definition at line 430 of file iconwidget.cpp.
◆ sceneEventFilter()
bool IconWidget::sceneEventFilter |
( |
QGraphicsItem * |
watched, |
|
|
QEvent * |
event |
|
) |
| |
|
protected |
◆ setAction()
void IconWidget::setAction |
( |
QAction * |
action | ) |
|
Associate an action with this IconWidget this makes the IconWidget follow the state of the action, using its icon, text, etc.
when the IconWidget is clicked, it will also trigger the action. Unlike addIconAction, there can be only one associated action.
Definition at line 458 of file iconwidget.cpp.
◆ setDrawBackground()
void IconWidget::setDrawBackground |
( |
bool |
draw | ) |
|
Sets whether or not to draw a background area for the icon.
- Parameters
-
draw | true if a background should be drawn or not |
Definition at line 482 of file iconwidget.cpp.
◆ setIcon() [1/2]
void IconWidget::setIcon |
( |
const QIcon & |
icon | ) |
|
◆ setIcon() [2/2]
void IconWidget::setIcon |
( |
const QString & |
icon | ) |
|
◆ setInfoText()
void IconWidget::setInfoText |
( |
const QString & |
text | ) |
|
Sets the additional information to be displayed by this icon.
- Parameters
-
text | additional meta text associated with this icon. |
Definition at line 1288 of file iconwidget.cpp.
◆ setMaximumIconSize()
void IconWidget::setMaximumIconSize |
( |
const QSizeF & |
size | ) |
|
Set the size that should be the maximum beyond the icon shouldn't scale when the icon will be when positioned in a layout.
- Parameters
-
preferred | icon size, pass an invalid size to unset this value |
- Since
- 4.5
Definition at line 1370 of file iconwidget.cpp.
◆ setMinimumIconSize()
void IconWidget::setMinimumIconSize |
( |
const QSizeF & |
size | ) |
|
Set the size that should be the minimum beyond the icon shouldn't scale when the icon will be when positioned in a layout.
- Parameters
-
preferred | icon size, pass an invalid size to unset this value |
- Since
- 4.5
Definition at line 1359 of file iconwidget.cpp.
◆ setNumDisplayLines()
void IconWidget::setNumDisplayLines |
( |
int |
numLines | ) |
|
- Parameters
-
numLines | the number of lines to show in the display. |
Definition at line 473 of file iconwidget.cpp.
◆ setOrientation()
void IconWidget::setOrientation |
( |
Qt::Orientation |
orientation | ) |
|
let set the orientation of the icon Qt::Vertical: text under the icon Qt::Horizontal text at a side of the icon depending by the direction of the language
- Parameters
-
orientation | the orientation we want |
Definition at line 1550 of file iconwidget.cpp.
◆ setPreferredIconSize()
void IconWidget::setPreferredIconSize |
( |
const QSizeF & |
size | ) |
|
Set the size you prefer the icon will be when positioned in a layout.
- Parameters
-
preferred | icon size, pass an invalid size to unset this value |
- Since
- 4.5
Definition at line 1348 of file iconwidget.cpp.
◆ setPressed
void IconWidget::setPressed |
( |
bool |
pressed = true | ) |
|
|
slot |
Sets the appearance of the icon to pressed or restores the appearance to normal.
This does not simulate a mouse button press.
- Parameters
-
pressed | whether to appear as pressed (true) or as normal (false) |
Definition at line 1527 of file iconwidget.cpp.
◆ setSvg()
void IconWidget::setSvg |
( |
const QString & |
svgFilePath, |
|
|
const QString & |
svgIconElement = QString() |
|
) |
| |
Convenience method to set the svg image to use when given the filepath and name of svg.
- Parameters
-
svgFilePath | the svg filepath including name of the svg. |
svgIconElement | the svg element to use when displaying the svg. Defaults to all of them. |
Definition at line 634 of file iconwidget.cpp.
◆ setText()
void IconWidget::setText |
( |
const QString & |
text | ) |
|
Sets the text associated with this icon.
- Parameters
-
text | the text to associate with this icon. |
Definition at line 1267 of file iconwidget.cpp.
◆ setTextBackgroundColor()
void IconWidget::setTextBackgroundColor |
( |
const QColor & |
color | ) |
|
Sets the color to use behind the text of the icon.
- Parameters
-
color | the color, or QColor() to reset it to no background color |
- Since
- 4.3
Definition at line 1230 of file iconwidget.cpp.
◆ setUnpressed
void IconWidget::setUnpressed |
( |
| ) |
|
|
slot |
◆ shape()
QPainterPath IconWidget::shape |
( |
| ) |
const |
◆ sizeFromIconSize()
QSizeF IconWidget::sizeFromIconSize |
( |
const qreal |
iconWidth | ) |
const |
- Returns
- optimal size given a size for the icon
- Parameters
-
iconWidth | desired width of the icon |
Definition at line 1571 of file iconwidget.cpp.
◆ sizeHint()
QSizeF IconWidget::sizeHint |
( |
Qt::SizeHint |
which, |
|
|
const QSizeF & |
constraint = QSizeF() |
|
) |
| const |
|
protected |
◆ svg()
QString IconWidget::svg |
( |
| ) |
const |
- Returns
- the path to the svg file set, if any
Definition at line 668 of file iconwidget.cpp.
◆ text()
QString IconWidget::text |
( |
| ) |
const |
Returns the text associated with this icon.
Definition at line 1283 of file iconwidget.cpp.
◆ textBackgroundColor()
QColor IconWidget::textBackgroundColor |
( |
| ) |
const |
- Returns
- the color to use behind the text of the icon
- Since
- 4.3
Definition at line 1237 of file iconwidget.cpp.
◆ action
QAction * Plasma::IconWidget::action |
|
readwrite |
◆ drawBackground
bool Plasma::IconWidget::drawBackground |
|
readwrite |
◆ icon
QIcon Plasma::IconWidget::icon |
|
readwrite |
◆ iconSize
QSizeF Plasma::IconWidget::iconSize |
|
read |
◆ infoText
QString Plasma::IconWidget::infoText |
|
readwrite |
◆ maximumIconSize
QSizeF Plasma::IconWidget::maximumIconSize |
|
readwrite |
◆ minimumIconSize
QSizeF Plasma::IconWidget::minimumIconSize |
|
readwrite |
◆ numDisplayLines
int IconWidget::numDisplayLines |
|
readwrite |
◆ orientation
Qt::Orientation Plasma::IconWidget::orientation |
|
readwrite |
◆ preferredIconSize
QSizeF Plasma::IconWidget::preferredIconSize |
|
readwrite |
◆ svg
QString Plasma::IconWidget::svg |
|
readwrite |
◆ text
QString Plasma::IconWidget::text |
|
readwrite |
◆ textBackgroundColor
QColor Plasma::IconWidget::textBackgroundColor |
|
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.