libplasma
Plasma::Icon Class Reference
#include <icon.h>
List of all members.
Detailed Description
Definition at line 51 of file icon.h.
Constructor & Destructor Documentation
Convenience constructor to create a Plasma::Icon with text.
- Parameters:
-
| text | the text that will be displayed with this icon. |
| parent | the QGraphicsItem this icon is parented to. |
Definition at line 269 of file icon.cpp.
Creates a new Plasma::Icon 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 277 of file icon.cpp.
Plasma::Icon::~Icon |
( |
|
) |
[virtual] |
Member Function Documentation
QAction * Plasma::Icon::action |
( |
|
) |
const |
- Returns:
- the currently associated action, if any.
Definition at line 345 of file icon.cpp.
void Plasma::Icon::activated |
( |
|
) |
[signal] |
Indicates when the icon has been activated following the single or doubleclick settings.
void Plasma::Icon::addIconAction |
( |
QAction * |
action |
) |
|
Plasma::Icon 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::Icon.
- Parameters:
-
| action | the QAction to associate with this icon. |
Definition at line 317 of file icon.cpp.
void Plasma::Icon::changed |
( |
|
) |
[signal] |
Indicates that something about the icon may have changed (image, text, etc) only actually works for icons associated with an action.
void Plasma::Icon::clicked |
( |
|
) |
[signal] |
Indicates when the icon has been clicked.
void Plasma::Icon::doubleClicked |
( |
|
) |
[signal] |
Indicates when the icon has been double-clicked.
void Plasma::Icon::drawActionButtonBase |
( |
QPainter * |
painter, |
|
|
const QSize & |
size, |
|
|
int |
element | |
|
) |
| | |
bool Plasma::Icon::drawBackground |
( |
|
) |
const |
- Returns:
- true if a background area is to be drawn for the icon
Definition at line 386 of file icon.cpp.
QIcon Plasma::Icon::icon |
( |
|
) |
const |
- Returns:
- the icon associated with this icon.
QSizeF Plasma::Icon::iconSize |
( |
|
) |
const |
QString Plasma::Icon::infoText |
( |
|
) |
const |
Returns the meta text associated with this icon.
bool Plasma::Icon::invertedLayout |
( |
|
) |
const |
- Returns:
- if the layout of the icons should appear inverted or not
Definition at line 1189 of file icon.cpp.
void Plasma::Icon::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 1184 of file icon.cpp.
bool Plasma::Icon::isDown |
( |
|
) |
[protected] |
int Plasma::Icon::numDisplayLines |
( |
|
) |
|
- Returns:
- the number of lines allowed to display
Definition at line 364 of file icon.cpp.
void Plasma::Icon::pressed |
( |
bool |
down |
) |
[signal] |
Indicates when the icon has been pressed.
void Plasma::Icon::setAction |
( |
QAction * |
action |
) |
|
Associate an action with this Icon this makes the Icon follow the state of the action, using its icon, text, etc.
when the Icon is clicked, it will also trigger the action. Unlike addIconAction, there can be only one associated action.
Definition at line 331 of file icon.cpp.
void Plasma::Icon::setDrawBackground |
( |
bool |
draw |
) |
|
Sets whether or not to draw a background area for the icon.
- draw true if a background should be drawn or not
Definition at line 378 of file icon.cpp.
void Plasma::Icon::setIcon |
( |
const QString & |
icon |
) |
|
void Plasma::Icon::setIcon |
( |
const QIcon & |
icon |
) |
|
Sets the graphical icon for this Plasma::Icon.
- Parameters:
-
| icon | the KIcon to associate with this icon. |
Definition at line 1018 of file icon.cpp.
void Plasma::Icon::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 988 of file icon.cpp.
void Plasma::Icon::setNumDisplayLines |
( |
int |
numLines |
) |
|
- Parameters:
-
| numLines | the number of lines to show in the display. |
Definition at line 369 of file icon.cpp.
void Plasma::Icon::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 1178 of file icon.cpp.
void Plasma::Icon::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 1146 of file icon.cpp.
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 493 of file icon.cpp.
void Plasma::Icon::setText |
( |
const QString & |
text |
) |
|
Sets the text associated with this icon.
- Parameters:
-
| text | the text to associate with this icon. |
Definition at line 973 of file icon.cpp.
void Plasma::Icon::setUnpressed |
( |
|
) |
[slot] |
Shortcut for setPressed(false).
Definition at line 1158 of file icon.cpp.
QSizeF Plasma::Icon::sizeFromIconSize |
( |
const qreal |
iconWidth |
) |
const |
- Returns:
- optimal size given a size for the icon
- Parameters:
-
| iconWidth | desired width of the icon |
Definition at line 1194 of file icon.cpp.
QString Plasma::Icon::text |
( |
|
) |
const |
Returns the text associated with this icon.
Property Documentation
QIcon Plasma::Icon::icon [read, write] |
QSizeF Plasma::Icon::iconSize [read] |
QString Plasma::Icon::infoText [read, write] |
QString Plasma::Icon::text [read, write] |
The documentation for this class was generated from the following files: