KDE 4.7 PyKDE API Reference

- KDE's Python API

# MarbleGraphicsItem Class Reference

`from PyKDE4.marble import *`

Namespace: Marble

## Detailed Description

Abstract class:
  This class can be used as a base class for new classes, but can not be instantiated directly.

## Enumerations
CacheMode | { NoCache, ItemCoordinateCache, DeviceCoordinateCache }
## Methods
| __init__ (self, Marble.MarbleGraphicsItem parent=0)
| __init__ (self, Marble.MarbleGraphicsItem other)
[QRectF] | boundingRects (self)
Marble.MarbleGraphicsItem.CacheMode | cacheMode (self)
bool | contains (self, QPointF point)
QRectF | containsRect (self, QPointF point)
QRectF | contentRect (self)
QSizeF | contentSize (self)
bool | eventFilter (self, QObject object, QEvent e)
| hide (self)
Marble.AbstractMarbleGraphicsLayout | layout (self)
| paint (self, Marble.GeoPainter painter, Marble.ViewportParams viewport, QString renderPos, Marble.GeoSceneLayer layer=0)
bool | paintEvent (self, Marble.GeoPainter painter, Marble.ViewportParams viewport, QString renderPos, Marble.GeoSceneLayer layer=0)
| setCacheMode (self, Marble.MarbleGraphicsItem.CacheMode mode, QSize logicalCacheSize=QSize())
| setContentSize (self, QSizeF size)
| setLayout (self, Marble.AbstractMarbleGraphicsLayout layout)
| setSize (self, QSizeF size)
| setToolTip (self, QString toolTip)
| setVisible (self, bool visible)
| show (self)
QSizeF | size (self)
QString | toolTip (self)
| update (self)
bool | visible (self)

## Method Documentation

__init__ | ( | self, |
|  | Marble.MarbleGraphicsItem | parent=0
| ) |  |  |

__init__ | ( | self, |
|  | Marble.MarbleGraphicsItem | other
| ) |  |  |

[QRectF] boundingRects | ( |  | self ) |

Used to get the set of screen bounding rects

Marble.MarbleGraphicsItem.CacheMode cacheMode | ( |  | self ) |

Returns the cache mode of the item

bool contains | ( | self, |
|  | QPointF | point
| ) |  |  |

Returns true if the Item contains point in parent coordinates.

QRectF containsRect | ( | self, |
|  | QPointF | point
| ) |  |  |

Returns the rect of one representation of the object that is at the given position.

QRectF contentRect | ( |  | self ) |

Returns the rect of the content in item coordinates.

QSizeF contentSize | ( |  | self ) |

Returns the size of the content of the MarbleGraphicsItem. This is identical to size() for default MarbleGraphicsItems.

bool eventFilter | ( | self, |
|  | QObject | object,
|  | QEvent | e
| ) |  |  |

hide | ( |  | self ) |

Hides the item. Equivalent to setVisible( false )

Marble.AbstractMarbleGraphicsLayout layout | ( |  | self ) |

Returns the layout of the MarbleGraphicsItem.

paint | ( | self, |
|  | Marble.GeoPainter | painter,
|  | Marble.ViewportParams | viewport,
|  | QString | renderPos,
|  | Marble.GeoSceneLayer | layer=0
| ) |  |  |

Paints the item in item coordinates. This has to be reimplemented by the subclass This function will be called by paintEvent().

bool paintEvent | ( | self, |
|  | Marble.GeoPainter | painter,
|  | Marble.ViewportParams | viewport,
|  | QString | renderPos,
|  | Marble.GeoSceneLayer | layer=0
| ) |  |  |

Paints the item on the screen in view coordinates. It is not safe to call this function from a thread other than the gui thread.

setCacheMode | ( | self, |
|  | Marble.MarbleGraphicsItem.CacheMode | mode,
|  | QSize | logicalCacheSize=QSize()
| ) |  |  |

Set the cache mode of the item

setContentSize | ( | self, |
|  | QSizeF | size
| ) |  |  |

Set the size of the content of the item.

setLayout | ( | self, |
|  | Marble.AbstractMarbleGraphicsLayout | layout
| ) |  |  |

Set the layout of the graphics item. The layout will now handle positions of added child items. The MarbleGraphicsItem takes ownership of the layout.

setSize | ( | self, |
|  | QSizeF | size
| ) |  |  |

Set the size of the item

setToolTip | ( | self, |
|  | QString | toolTip
| ) |  |  |

Set the tool tip for this GraphicItem.

setVisible | ( | self, |
|  | bool | visible
| ) |  |  |

Makes the item visible or invisible, depending on visible.

show | ( |  | self ) |

Shows the item. Equivalent to setVisible( true )

QSizeF size | ( |  | self ) |

Returns the size of the item

QString toolTip | ( |  | self ) |

Returns the items tool tip or, if no tool tip has been set, an empty string.

update | ( |  | self ) |

Schedules an painting update for the Item. As long it is not added to an GraphicsScene (which doesn't exist yet) it will be repainted at the next paint event instead of using the cache.

bool visible | ( |  | self ) |

Returns if the item is visible.

## Enumeration Documentation

CacheMode

Enumerator:

  NoCache |
  ItemCoordinateCache |
  DeviceCoordinateCache |