KDE 4.7 PyKDE API Reference

- KDE's Python API

# ItemBackground Class Reference

`from PyKDE4.plasma import *`

Inherits: QGraphicsWidget → QObject
Namespace: Plasma

## Detailed Description

## Signals
| animationStep (float progress)
| appearanceChanged ()
| targetItemReached (QGraphicsItem a0)
| targetReached (QRectF a0)
## Methods
| __init__ (self, QGraphicsWidget parent=0)
bool | eventFilter (self, QObject watched, QEvent event)
QVariant | itemChange (self, QGraphicsItem::GraphicsItemChange change, QVariant value)
| paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget)
| resizeEvent (self, QGraphicsSceneResizeEvent a0)
bool | sceneEventFilter (self, QGraphicsItem watched, QEvent event)
| setTarget (self, QRectF newGeometry)
| setTargetItem (self, QGraphicsItem target)
QRectF | target (self)
QGraphicsItem | targetItem (self)

## Signal Documentation

animationStep | ( | float | progress
| ) |  |  |

Emitted at each animation frame. Useful for synchronizing item animations

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

appearanceChanged | ( |  | ) |

Emitted when the visual layout and appearance changes. Useful for synchronizing content margins.

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

targetItemReached | ( | QGraphicsItem | a0
| ) |  |  |

Emitted when the target has been reached. Useful to consider this instead of the corresponding hoverEnterEvent;

Signal syntax:
  `QObject.connect(source, SIGNAL("targetItemReached(QGraphicsItem*)"), target_slot)`

targetReached | ( | QRectF | a0
| ) |  |  |

Emitted when the target has been reached. Useful to consider this instead of the corresponding hoverEnterEvent;

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

## Method Documentation

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

bool eventFilter | ( | self, |
|  | QObject | watched,
|  | QEvent | event
| ) |  |  |

from QObject

QVariant itemChange | ( | self, |
|  | QGraphicsItem::GraphicsItemChange | change,
|  | QVariant | value
| ) |  |  |

from QGraphicsWidget

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

from QGraphicsWidget

resizeEvent | ( | self, |
|  | QGraphicsSceneResizeEvent | a0
| ) |  |  |

from QGraphicsItem

bool sceneEventFilter | ( | self, |
|  | QGraphicsItem | watched,
|  | QEvent | event
| ) |  |  |

from QGraphicsItem

setTarget | ( | self, |
|  | QRectF | newGeometry
| ) |  |  |

Sets a new target geometry we want at the end of animation

Parameters:

  | newGeometry | the final geometry target

setTargetItem | ( | self, |
|  | QGraphicsItem | target
| ) |  |  |

set the ItemBackground geometry to be the target geometry, plus the ItemBackground margins

QRectF target | ( |  | self ) |

Returns:
  the current target rect; may be empty if there is no target currently set

QGraphicsItem targetItem | ( |  | self ) |

Returns:
  the target item, if any