Plasma
#include <iconwidget.h>
Definition at line 56 of file iconwidget.h.
IconWidget::IconWidget |
( |
QGraphicsItem * |
parent = 0 | ) |
|
|
explicit |
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::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 |
( |
| ) |
|
|
virtual |
QAction* Plasma::IconWidget::action |
( |
| ) |
const |
- Returns
- the currently associated action, if any.
void Plasma::IconWidget::activated |
( |
| ) |
|
|
signal |
Indicates when the icon has been activated following the single or doubleclick settings.
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.
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.
void IconWidget::changeEvent |
( |
QEvent * |
event | ) |
|
|
protected |
void Plasma::IconWidget::clicked |
( |
| ) |
|
|
signal |
Indicates when the icon has been clicked.
void Plasma::IconWidget::doubleClicked |
( |
| ) |
|
|
signal |
Indicates when the icon has been double-clicked.
void IconWidget::drawActionButtonBase |
( |
QPainter * |
painter, |
|
|
const QSize & |
size, |
|
|
int |
element |
|
) |
| |
bool Plasma::IconWidget::drawBackground |
( |
| ) |
const |
- Returns
- true if a background area is to be drawn for the icon
void IconWidget::hoverEnterEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
protected |
void IconWidget::hoverLeaveEvent |
( |
QGraphicsSceneHoverEvent * |
event | ) |
|
|
protected |
QIcon Plasma::IconWidget::icon |
( |
| ) |
const |
- Returns
- the icon associated with this icon.
QSizeF Plasma::IconWidget::iconSize |
( |
| ) |
const |
QString Plasma::IconWidget::infoText |
( |
| ) |
const |
Returns the meta text associated with this icon.
bool IconWidget::invertedLayout |
( |
| ) |
const |
- Returns
- if the layout of the icons should appear inverted or not
Definition at line 1566 of file iconwidget.cpp.
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.
bool IconWidget::isDown |
( |
| ) |
|
|
protected |
QSizeF Plasma::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
QSizeF Plasma::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
void IconWidget::mouseDoubleClickEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
void IconWidget::mouseMoveEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
void IconWidget::mousePressEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
void IconWidget::mouseReleaseEvent |
( |
QGraphicsSceneMouseEvent * |
event | ) |
|
|
protected |
int Plasma::IconWidget::numDisplayLines |
( |
| ) |
|
- Returns
- the number of lines allowed to display
Qt::Orientation Plasma::IconWidget::orientation |
( |
| ) |
const |
- Returns
- the orientation of the icon
QSizeF Plasma::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
void Plasma::IconWidget::pressed |
( |
bool |
down | ) |
|
|
signal |
Indicates when the icon has been pressed.
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.
bool IconWidget::sceneEventFilter |
( |
QGraphicsItem * |
watched, |
|
|
QEvent * |
event |
|
) |
| |
|
protected |
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.
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.
void IconWidget::setIcon |
( |
const QIcon & |
icon | ) |
|
void IconWidget::setIcon |
( |
const QString & |
icon | ) |
|
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.
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.
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.
void IconWidget::setNumDisplayLines |
( |
int |
numLines | ) |
|
- Parameters
-
numLines | the number of lines to show in the display. |
Definition at line 473 of file iconwidget.cpp.
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.
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.
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.
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.
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.
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.
void IconWidget::setUnpressed |
( |
| ) |
|
|
slot |
QPainterPath IconWidget::shape |
( |
| ) |
const |
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.
QSizeF IconWidget::sizeHint |
( |
Qt::SizeHint |
which, |
|
|
const QSizeF & |
constraint = QSizeF() |
|
) |
| const |
|
protected |
QString Plasma::IconWidget::svg |
( |
| ) |
const |
- Returns
- the path to the svg file set, if any
QString Plasma::IconWidget::text |
( |
| ) |
const |
Returns the text associated with this icon.
QColor Plasma::IconWidget::textBackgroundColor |
( |
| ) |
const |
- Returns
- the color to use behind the text of the icon
- Since
- 4.3
QAction * IconWidget::action |
|
readwrite |
bool IconWidget::drawBackground |
|
readwrite |
QSizeF IconWidget::iconSize |
|
read |
QString IconWidget::infoText |
|
readwrite |
QSizeF IconWidget::maximumIconSize |
|
readwrite |
QSizeF IconWidget::minimumIconSize |
|
readwrite |
int IconWidget::numDisplayLines |
|
readwrite |
Qt::Orientation IconWidget::orientation |
|
readwrite |
QSizeF IconWidget::preferredIconSize |
|
readwrite |
QColor 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-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.