libplasma
Plasma::PushButton Class Reference
#include <pushbutton.h>

Detailed Description
Class that emulates a QPushButton inside Plasma.
Definition at line 48 of file pushbutton.h.
Signals | |
| void | clicked () |
| void | toggled (bool checked) |
Public Member Functions | |
| PushButton (Widget *parent=0) | |
| PushButton (const QString &text, Widget *parent=0) | |
| PushButton (const KIcon &icon, const QString &text, Widget *parent=0) | |
| virtual | ~PushButton () |
| QString | text () const |
| void | setText (const QString &text) |
| KIcon | icon () const |
| void | setIcon (const KIcon &icon) |
| Q_INVOKABLE void | setIcon (const QString &path) |
| QSizeF | iconSize () const |
| void | setIconSize (const QSizeF &size) |
| bool | isDown () const |
| bool | isFlat () const |
| void | setFlat (bool flat) |
| bool | isCheckable () const |
| void | setCheckable (bool checkable) |
| bool | isChecked () const |
| void | setChecked (bool checked) |
| QSizeF | minimumSize () const |
| Qt::Orientations | expandingDirections () const |
| QSizeF | sizeHint () const |
Protected Member Functions | |
| void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
| void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
| void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
| void | paintWidget (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
Properties | |
| QString | text |
| QSizeF | iconSize |
| KIcon | icon |
| bool | flat |
| bool | checkable |
| bool | checked |
Constructor & Destructor Documentation
| Plasma::PushButton::PushButton | ( | Widget * | parent = 0 |
) | [explicit] |
Creates a new Plasma::PushButton.
- Parameters:
-
parent the Widge this button is parented to.
Definition at line 120 of file pushbutton.cpp.
Creates a new Plasma::PushButton with a text label.
- Parameters:
-
text the text to display next to the button. parent the QGraphicsItem this icon is parented to.
Definition at line 127 of file pushbutton.cpp.
| Plasma::PushButton::PushButton | ( | const KIcon & | icon, | |
| const QString & | text, | |||
| Widget * | parent = 0 | |||
| ) | [explicit] |
Creates a new Plasma::PushButton with an icon and text.
- Parameters:
-
icon the icon to display with this button. text the text to display with this button. parent the QGraphicsItem this icon is parented to.
Definition at line 135 of file pushbutton.cpp.
| Plasma::PushButton::~PushButton | ( | ) | [virtual] |
Member Function Documentation
| QString Plasma::PushButton::text | ( | ) | const |
| void Plasma::PushButton::setText | ( | const QString & | text | ) |
Sets the text to be displayed by this button.
- Parameters:
-
text the text to display
Definition at line 162 of file pushbutton.cpp.
| KIcon Plasma::PushButton::icon | ( | ) | const |
- Returns:
- the icon displayed by this button.
| void Plasma::PushButton::setIcon | ( | const KIcon & | icon | ) |
Sets the icon to be displayed by this Plasma::Icon.
- Parameters:
-
icon the KIcon to display.
Definition at line 173 of file pushbutton.cpp.
| void Plasma::PushButton::setIcon | ( | const QString & | path | ) |
Convenience method to set the icon of this Plasma::PushButton based on the icon path, or name.
- See also:
- KIconLoader
- Parameters:
-
path the path to, or name of the icon to display.
Definition at line 179 of file pushbutton.cpp.
| QSizeF Plasma::PushButton::iconSize | ( | ) | const |
| void Plasma::PushButton::setIconSize | ( | const QSizeF & | size | ) |
Sets the size of icon shown by this button.
- Parameters:
-
size size of the icon.
Definition at line 199 of file pushbutton.cpp.
| bool Plasma::PushButton::isDown | ( | ) | const |
- Returns:
- whether this button is currently in a down/pressed state.
Definition at line 208 of file pushbutton.cpp.
| bool Plasma::PushButton::isFlat | ( | ) | const |
| void Plasma::PushButton::setFlat | ( | bool | flat | ) |
Sets whether the button is drawn flat.
- Parameters:
-
flat whether to draw it flat or not.
Definition at line 218 of file pushbutton.cpp.
| bool Plasma::PushButton::isCheckable | ( | ) | const |
| void Plasma::PushButton::setCheckable | ( | bool | checkable | ) |
Sets whether the button is checkable.
- Parameters:
-
checkable whether button is checkable or not.
Definition at line 242 of file pushbutton.cpp.
| bool Plasma::PushButton::isChecked | ( | ) | const |
| void Plasma::PushButton::setChecked | ( | bool | checked | ) |
Sets whether the button is checked.
- Parameters:
-
checked whether button is checked or not.
Definition at line 229 of file pushbutton.cpp.
| QSizeF Plasma::PushButton::minimumSize | ( | ) | const [virtual] |
- Returns:
- minimum size of the Widget.
Reimplemented from Plasma::Widget.
Definition at line 285 of file pushbutton.cpp.
| Qt::Orientations Plasma::PushButton::expandingDirections | ( | ) | const [virtual] |
This method is used by Plasma::Layout to determine which directions the widget naturally expands.
- Returns:
- bitmask with the directions that this Widget can be expanded.
Reimplemented from Plasma::Widget.
Definition at line 291 of file pushbutton.cpp.
| QSizeF Plasma::PushButton::sizeHint | ( | ) | const [virtual] |
Returns the recommended size for this widget.
Note that this size is not necessarily only the size for the widget, but might also include margins etc.
- Returns:
- recommended size for this Plasma::Widget.
Reimplemented from Plasma::Widget.
Definition at line 296 of file pushbutton.cpp.
| void Plasma::PushButton::clicked | ( | ) | [signal] |
Triggered when the button has been clicked.
| void Plasma::PushButton::toggled | ( | bool | checked | ) | [signal] |
Triggered when the checkable button has been toggled.
| void Plasma::PushButton::mousePressEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
| void Plasma::PushButton::mouseMoveEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
| void Plasma::PushButton::mouseReleaseEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
| void Plasma::PushButton::paintWidget | ( | QPainter * | painter, | |
| const QStyleOptionGraphicsItem * | option, | |||
| QWidget * | widget = 0 | |||
| ) | [protected, virtual] |
Paints the widget.
- Parameters:
-
painter the QPainter to use to paint. option the style option used to give specific info on the item being dawn. widget the parent QWidget (most likely the Corona)
Reimplemented from Plasma::Widget.
Definition at line 149 of file pushbutton.cpp.
Property Documentation
QString Plasma::PushButton::text [read, write] |
Definition at line 51 of file pushbutton.h.
QSizeF Plasma::PushButton::iconSize [read, write] |
Definition at line 52 of file pushbutton.h.
KIcon Plasma::PushButton::icon [read, write] |
Definition at line 53 of file pushbutton.h.
bool Plasma::PushButton::flat [read, write] |
Definition at line 54 of file pushbutton.h.
bool Plasma::PushButton::checkable [read, write] |
Definition at line 55 of file pushbutton.h.
bool Plasma::PushButton::checked [read, write] |
Definition at line 56 of file pushbutton.h.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference