Marble.GeoDataTreeModel

KDE 4.9 PyKDE API Reference

- KDE's Python API

# GeoDataTreeModel Class Reference

`from PyKDE4.marble import *`

Inherits: QAbstractItemModel → QObject
Namespace: Marble

## Detailed Description

The representation of GeoData in a model This class represents all available data given by kml-data files.

## Signals
| added (Marble.GeoDataObject object)
| removed (Marble.GeoDataObject object)
## Methods
| __init__ (self, QObject parent=0)
int | addDocument (self, Marble.GeoDataDocument document)
int | addFeature (self, Marble.GeoDataContainer parent, Marble.GeoDataFeature feature)
int | columnCount (self, QModelIndex parent=QModelIndex())
QVariant | data (self, QModelIndex index, int role)
Qt::ItemFlags | flags (self, QModelIndex index)
bool | hasChildren (self, QModelIndex parent)
QVariant | headerData (self, int section, Qt::Orientation orientation, int role=Qt.DisplayRole)
QModelIndex | index (self, int row, int column, QModelIndex parent=QModelIndex())
QModelIndex | index (self, Marble.GeoDataObject object)
QModelIndex | parent (self, QModelIndex index)
| removeDocument (self, int index)
| removeDocument (self, Marble.GeoDataDocument document)
bool | removeFeature (self, Marble.GeoDataContainer parent, int index)
bool | removeFeature (self, Marble.GeoDataFeature feature)
| reset (self)
Marble.GeoDataDocument | rootDocument (self)
int | rowCount (self, QModelIndex parent=QModelIndex())
bool | setData (self, QModelIndex index, QVariant value, int role=Qt.EditRole)
| setRootDocument (self, Marble.GeoDataDocument document)
| update (self)
| updateFeature (self, Marble.GeoDataFeature feature)

## Signal Documentation

added | ( | Marble.GeoDataObject | object
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("added(Marble::GeoDataObject*)"), target_slot)`

removed | ( | Marble.GeoDataObject | object
| ) |  |  |

Signal syntax:
  `QObject.connect(source, SIGNAL("removed(Marble::GeoDataObject*)"), target_slot)`

## Method Documentation

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

Creates a new GeoDataTreeModel.

Parameters:

  | parent | The parent object.

int addDocument | ( | self, |
|  | Marble.GeoDataDocument | document
| ) |  |  |

int addFeature | ( | self, |
|  | Marble.GeoDataContainer | parent,
|  | Marble.GeoDataFeature | feature
| ) |  |  |

int columnCount | ( | self, |
|  | QModelIndex | parent=QModelIndex()
| ) |  |  |

QVariant data | ( | self, |
|  | QModelIndex | index,
|  | int | role
| ) |  |  |

Qt::ItemFlags flags | ( | self, |
|  | QModelIndex | index
| ) |  |  |

bool hasChildren | ( | self, |
|  | QModelIndex | parent
| ) |  |  |

QVariant headerData | ( | self, |
|  | int | section,
|  | Qt::Orientation | orientation,
|  | int | role=Qt.DisplayRole
| ) |  |  |

QModelIndex index | ( | self, |
|  | int | row,
|  | int | column,
|  | QModelIndex | parent=QModelIndex()
| ) |  |  |

QModelIndex index | ( | self, |
|  | Marble.GeoDataObject | object
| ) |  |  |

QModelIndex parent | ( | self, |
|  | QModelIndex | index
| ) |  |  |

removeDocument | ( | self, |
|  | int | index
| ) |  |  |

removeDocument | ( | self, |
|  | Marble.GeoDataDocument | document
| ) |  |  |

bool removeFeature | ( | self, |
|  | Marble.GeoDataContainer | parent,
|  | int | index
| ) |  |  |

bool removeFeature | ( | self, |
|  | Marble.GeoDataFeature | feature
| ) |  |  |

reset | ( |  | self ) |

Marble.GeoDataDocument rootDocument | ( |  | self ) |

int rowCount | ( | self, |
|  | QModelIndex | parent=QModelIndex()
| ) |  |  |

Return the number of Items in the Model.

bool setData | ( | self, |
|  | QModelIndex | index,
|  | QVariant | value,
|  | int | role=Qt.EditRole
| ) |  |  |

setRootDocument | ( | self, |
|  | Marble.GeoDataDocument | document
| ) |  |  |

Sets the root document to use. This replaces previously loaded data, if any.

Parameters:

  | document | The new root document. Ownership retains with the caller, i.e. GeoDataTreeModel will not delete the passed document at its destruction.

update | ( |  | self ) |

updateFeature | ( | self, |
|  | Marble.GeoDataFeature | feature
| ) |  |  |