Plasma.ToolButton

KDE 4.2 PyKDE API Reference

- KDE's Python API

# ToolButton Class Reference

`from PyKDE4.plasma import *`

Inherits: QGraphicsProxyWidget → QGraphicsWidget → QObject
Namespace: Plasma

## Detailed Description

ToolButton plasma/widgets/pushbutton.h <Plasma/Widgets/ToolButton>

Provides a plasma-themed QToolButton.

## Signals
| clicked ()
## Methods
| __init__ (self, QGraphicsWidget parent=0)
bool | autoRaise (self)
| clicked (self)
| hoverEnterEvent (self, QGraphicsSceneHoverEvent event)
| hoverLeaveEvent (self, QGraphicsSceneHoverEvent event)
QString | image (self)
QToolButton | nativeWidget (self)
| paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget=0)
| resizeEvent (self, QGraphicsSceneResizeEvent event)
| setAutoRaise (self, bool raise)
| setImage (self, QString path)
| setStyleSheet (self, QString stylesheet)
| setText (self, QString text)
QString | styleSheet (self)
QString | text (self)

## Method Documentation

__init__ | ( | self, |
|  | QGraphicsWidget | parent=0
| ) |  |  |

bool autoRaise | ( |  | self ) |

Returns:
  true if the toolbutton has an autoraise behaviour

clicked | ( |  | self ) |

Signal syntax:
  `QObject.connect(source, SIGNAL("clicked()"), target_slot)`

hoverEnterEvent | ( | self, |
|  | QGraphicsSceneHoverEvent | event
| ) |  |  |

hoverLeaveEvent | ( | self, |
|  | QGraphicsSceneHoverEvent | event
| ) |  |  |

QString image | ( |  | self ) |

Returns:
  the image path being displayed currently, or an empty string if none.

QToolButton nativeWidget | ( |  | self ) |

Returns:
  the native widget wrapped by this ToolButton

paint | ( | self, |
|  | QPainter | painter,
|  | QStyleOptionGraphicsItem | option,
|  | QWidget | widget=0
| ) |  |  |

resizeEvent | ( | self, |
|  | QGraphicsSceneResizeEvent | event
| ) |  |  |

setAutoRaise | ( | self, |
|  | bool | raise
| ) |  |  |

Sets if the toolbutton has an autoraise behaviour

@arg raise

setImage | ( | self, |
|  | QString | path
| ) |  |  |

Sets the path to an image to display.

@arg path the path to the image; if a relative path, then a themed image will be loaded.

setStyleSheet | ( | self, |
|  | QString | stylesheet
| ) |  |  |

Sets the stylesheet used to control the visual display of this ToolButton

@arg stylesheet a CSS string

setText | ( | self, |
|  | QString | text
| ) |  |  |

Sets the display text for this ToolButton

@arg text the text to display; should be translated.

QString styleSheet | ( |  | self ) |

Returns:
  the stylesheet currently used with this widget

QString text | ( |  | self ) |

Returns:
  the display text