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 () |
| pressed () |
| released () |
Methods |
| __init__ (self, QGraphicsWidget parent=0) |
QAction | action (self) |
bool | autoRaise (self) |
| changeEvent (self, QEvent event) |
| hoverEnterEvent (self, QGraphicsSceneHoverEvent event) |
| hoverLeaveEvent (self, QGraphicsSceneHoverEvent event) |
QIcon | icon (self) |
QString | image (self) |
bool | isDown (self) |
QToolButton | nativeWidget (self) |
| paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget=0) |
| resizeEvent (self, QGraphicsSceneResizeEvent event) |
| setAction (self, QAction action) |
| setAutoRaise (self, bool raise) |
| setDown (self, bool down) |
| setIcon (self, QIcon icon) |
| setImage (self, QString path) |
| setImage (self, QString path, QString elementid) |
| setStyleSheet (self, QString stylesheet) |
| setText (self, QString text) |
QSizeF | sizeHint (self, Qt::SizeHint which, QSizeF constraint) |
QString | styleSheet (self) |
QString | text (self) |
Signal Documentation
- Signal syntax:
QObject.connect(source, SIGNAL("clicked()"), target_slot)
- Since:
- 4.4
- Signal syntax:
QObject.connect(source, SIGNAL("pressed()"), target_slot)
- Since:
- 4.4
- Signal syntax:
QObject.connect(source, SIGNAL("released()"), target_slot)
Method Documentation
- Returns:
- the currently associated action, if any.
- Since:
- 4.3
- Returns:
- true if the toolbutton has an autoraise behaviour
changeEvent |
( |
self, |
|
|
|
QEvent |
event |
|
) |
|
|
|
- Returns:
- the icon of this button
- Since:
- 4.3
- Returns:
- the image path being displayed currently, or an empty string if none.
- Returns:
- true if the button is pressed down
- Since:
- 4.4
- Returns:
- the native widget wrapped by this ToolButton
Associate an action with this IconWidget
this makes the button follow the state of the action, using its icon, text, etc.
when the button is clicked, it will also trigger the action.
- Since:
- 4.3
setAutoRaise |
( |
self, |
|
|
|
bool |
raise |
|
) |
|
|
|
Sets if the toolbutton has an autoraise behaviour
@arg raise
setDown |
( |
self, |
|
|
|
bool |
down |
|
) |
|
|
|
Sets the status of the button to pressed
@arg down
- Since:
- 4.5
setIcon |
( |
self, |
|
|
|
QIcon |
icon |
|
) |
|
|
|
sets the icon for this toolbutton
@arg icon the icon we want to use
- Since:
- 4.3
Sets the path to an svg image to display and the id of the used svg element, if necessary.
@arg path the path to the image; if a relative path, then a themed image will be loaded.
@arg elementid the id of a svg element.
- Since:
- 4.4
Sets the path to an svg image to display and the id of the used svg element, if necessary.
@arg path the path to the image; if a relative path, then a themed image will be loaded.
@arg elementid the id of a svg element.
- Since:
- 4.4
setStyleSheet |
( |
self, |
|
|
|
QString |
stylesheet |
|
) |
|
|
|
Sets the stylesheet used to control the visual display of this ToolButton
@arg stylesheet a CSS string
Sets the display text for this ToolButton
@arg text the text to display; should be translated.
- Returns:
- the stylesheet currently used with this widget
- Returns:
- the display text