KDE 4.7 PyKDE API Reference

- KDE's Python API

# MarbleModel Class Reference

`from PyKDE4.marble import *`

Inherits: QObject
Namespace: Marble

## Detailed Description

The data model (not based on QAbstractModel) for a MarbleWidget.

This class provides a data storage and indexer that can be displayed in a MarbleWidget. It contains 3 different datatypes: tiles which provide the background, vectors which provide things like country borders and coastlines and placemarks which can show points of interest, such as cities, mountain tops or the poles.

The tiles provide the background of the image and can be for instance height and depth fields, magnetic strength, topographic data or anything else that is area based.

The vectors provide things like country borders and coastlines. They are stored in separate files and can be added or removed at anytime.

The placemarks contain points of interest, such as cities, mountain tops or the poles. These are sorted by size (for cities) and category (capitals, other important cities, less important cities, etc) and are displayed with different color or shape like square or round.

See also:
  MarbleWidget

## Signals

| creatingTilesStart (Marble.TileCreator a0, QString name, QString description)
| modelChanged ()
| themeChanged (QString mapTheme)

## Methods

| __init__ (self, QObject parent)
| addGeoDataFile (self, QString filename)
| addGeoDataString (self, QString data, QString key="data")
| addPlacemarkData (self, QString data, QString key="data")
| addPlacemarkFile (self, QString filename)
| clearPersistentTileCache (self)
QDateTime | clockDateTime (self)
int | clockSpeed (self)
int | clockTimezone (self)
| home (self, float lon, float lat, int zoom)
QTextDocument | legend (self)
QString | mapThemeId (self)
Marble.MapThemeManager | mapThemeManager (self)
| openGpxFile (self, QString filename)
long | persistentTileCacheLimit (self)
QAbstractItemModel | placemarkModel (self)
QItemSelectionModel | placemarkSelectionModel (self)
Marble.Planet | planet (self)
QString | planetId (self)
QString | planetName (self)
float | planetRadius (self)
Marble.PositionTracking | positionTracking (self)
| removeGeoData (self, QString key)
| removePlacemarkKey (self, QString key)
| setClockDateTime (self, QDateTime datetime)
| setClockSpeed (self, int speed)
| setClockTimezone (self, int timeInSec)
| setHome (self, float lon, float lat, int zoom=1050)
| setHome (self, Marble.GeoDataCoordinates homePoint, int zoom=1050)
| setLegend (self, QTextDocument document)
| setPersistentTileCacheLimit (self, long kiloBytes)
Marble.SunLocator | sunLocator (self)
QAbstractItemModel | treeModel (self)

## Signal Documentation

creatingTilesStart | ( | Marble.TileCreator | a0,
|  | QString | name,
|  | QString | description
| ) |  |  |

Signal that the MarbleModel has started to create a new set of tiles. @param

See also:
  zoomView()

Signal syntax:
  `QObject.connect(source, SIGNAL("creatingTilesStart(Marble::TileCreator*, const QString&, const QString&)"), target_slot)`

modelChanged | ( |  | ) |

Signal that the MarbleModel has changed in general

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

themeChanged | ( | QString | mapTheme
| ) |  |  |

Signal that the map theme has changed, and to which theme.

Parameters:

  | mapTheme | the identifier of the new map theme.

See also:
  mapTheme

See also:
  setMapTheme

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

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent
| ) |  |  |

Construct a new MarbleModel.

Parameters:

  | parent | the parent widget

addGeoDataFile | ( | self, |
|  | QString | filename
| ) |  |  |

addGeoDataString | ( | self, |
|  | QString | data,
|  | QString | key="data"
| ) |  |  |

addPlacemarkData | ( | self, |
|  | QString | data,
|  | QString | key="data"
| ) |  |  |

Deprecated:
  Please use addGeoDataString instead

addPlacemarkFile | ( | self, |
|  | QString | filename
| ) |  |  |

Deprecated:
  Please use addGeoDataFile instead

clearPersistentTileCache | ( |  | self ) |

QDateTime clockDateTime | ( |  | self ) |

int clockSpeed | ( |  | self ) |

int clockTimezone | ( |  | self ) |

home | ( | self, |
|  | float | lon,
|  | float | lat,
|  | int | zoom
| ) |  |  |

get the home point

Parameters:

  |  | lon the longitude of the home point.
  |  | lat the latitude of the home point.
  |  | zoom the default zoom level of the home point.

QTextDocument legend | ( |  | self ) |

QString mapThemeId | ( |  | self ) |

Return the name of the current map theme.

Returns:
  the identifier of the current MapTheme. To ensure that a unique identifier is being used the theme does NOT get represented by its name but the by relative location of the file that specifies the theme:

Example: maptheme = "earth/bluemarble/bluemarble.dgml"

Marble.MapThemeManager mapThemeManager | ( |  | self ) |

openGpxFile | ( | self, |
|  | QString | filename
| ) |  |  |

Deprecated:
  Please use addGeoDataFile instead

long persistentTileCacheLimit | ( |  | self ) |

Returns the limit in kilobytes of the persistent (on hard disc) tile cache.

Returns:
  the limit of persistent tile cache in kilobytes.

QAbstractItemModel placemarkModel | ( |  | self ) |

QItemSelectionModel placemarkSelectionModel | ( |  | self ) |

Marble.Planet planet | ( |  | self ) |

Returns the planet object for the current map.

Returns:
  the planet object for the current map

QString planetId | ( |  | self ) |

QString planetName | ( |  | self ) |

float planetRadius | ( |  | self ) |

Marble.PositionTracking positionTracking | ( |  | self ) |

removeGeoData | ( | self, |
|  | QString | key
| ) |  |  |

removePlacemarkKey | ( | self, |
|  | QString | key
| ) |  |  |

Deprecated:
  Please use removeGeoData instead

setClockDateTime | ( | self, |
|  | QDateTime | datetime
| ) |  |  |

setClockSpeed | ( | self, |
|  | int | speed
| ) |  |  |

setClockTimezone | ( | self, |
|  | int | timeInSec
| ) |  |  |

setHome | ( | self, |
|  | float | lon,
|  | float | lat,
|  | int | zoom=1050
| ) |  |  |

Set the home point

Parameters:

  |  | homePoint the new home point.
  |  | zoom the default zoom level for the new home point.

setHome | ( | self, |
|  | Marble.GeoDataCoordinates | homePoint,
|  | int | zoom=1050
| ) |  |  |

Set the home point

Parameters:

  |  | homePoint the new home point.
  |  | zoom the default zoom level for the new home point.

setLegend | ( | self, |
|  | QTextDocument | document
| ) |  |  |

setPersistentTileCacheLimit | ( | self, |
|  | long | kiloBytes
| ) |  |  |

Set the limit of the persistent (on hard disc) tile cache.

Parameters:

  |  | bytes The limit in kilobytes, 0 means no limit.

Marble.SunLocator sunLocator | ( |  | self ) |

QAbstractItemModel treeModel | ( |  | self ) |

Return the list of Placemarks as a QAbstractItemModel *

Returns:
  a list of all Placemarks in the MarbleModel.