KDE 4.7 PyKDE API Reference

- KDE's Python API

# Frame Class Reference

`from PyKDE4.plasma import *`

Inherits: QGraphicsWidget → QObject
Namespace: Plasma

## Detailed Description

Frame plasma/widgets/frame.h <Plasma/Widgets/Frame>

A widget that provides a simple frame

A simple frame to group widgets, it can have a plain, sunken or raise aspect the default aspect is plain

## Enumerations
Shadow | { Plain, Raised, Sunken }
## Methods
| __init__ (self, QGraphicsWidget parent=0)
| changeEvent (self, QEvent event)
Plasma.FrameSvg.EnabledBorders | enabledBorders (self)
Plasma.Frame.Shadow | frameShadow (self)
QString | image (self)
QWidget | nativeWidget (self)
| paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget=0)
| resizeEvent (self, QGraphicsSceneResizeEvent event)
| setEnabledBorders (self, Plasma.FrameSvg.EnabledBorders borders)
| setFrameShadow (self, Plasma.Frame.Shadow shadow)
| setImage (self, QString path)
| setStyleSheet (self, QString stylesheet)
| setText (self, QString text)
QSizeF | sizeHint (self, Qt::SizeHint which, QSizeF constraint)
QString | styleSheet (self)
QString | text (self)

## Method Documentation

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

Constructs a new Frame

Parameters:

  | parent | the parent of this widget

changeEvent | ( | self, |
|  | QEvent | event
| ) |  |  |

Plasma.FrameSvg.EnabledBorders enabledBorders | ( |  | self ) |

Convenience method to get the enabled borders

Returns:
  what borders are painted

Since:
  4.4

Plasma.Frame.Shadow frameShadow | ( |  | self ) |

Returns:
  the Frame's shadow style

QString image | ( |  | self ) |

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

QWidget nativeWidget | ( |  | self ) |

Returns:
  the native widget wrapped by this Frame

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

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

setEnabledBorders | ( | self, |
|  | Plasma.FrameSvg.EnabledBorders | borders
| ) |  |  |

Sets what borders should be painted

Parameters:

  | flags | borders we want to paint

setFrameShadow | ( | self, |
|  | Plasma.Frame.Shadow | shadow
| ) |  |  |

Sets the Frame's shadow style

Parameters:

  | shadow | plain, raised or sunken

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

Sets the path to an image to display.

Parameters:

  | 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 Frame

Parameters:

  | stylesheet | a CSS string

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

Set the text to display by this Frame

Parameters:

  | text | the text

Since:
  4.4

QSizeF sizeHint | ( | self, |
|  | Qt::SizeHint | which,
|  | QSizeF | constraint
| ) |  |  |

QString styleSheet | ( |  | self ) |

Returns:
  the stylesheet currently used with this widget

QString text | ( |  | self ) |

Returns:
  text displayed from this Frame

## Enumeration Documentation

Shadow

Enumerator:

  Plain = 1 |
  Raised = 2 |
  Sunken = 3 |