RoutingModel Class Reference
from PyKDE4.marble import *
Inherits: QAbstractListModel → QAbstractItemModel → QObject
Namespace: Marble
Detailed Description
Enumerations |
RoutingModelRoles | { CoordinateRole, TurnTypeIconRole, LongitudeRole, LatitudeRole } |
Signals |
| currentRouteChanged () |
| deviatedFromRoute (bool deviated) |
| positionChanged () |
Methods |
| __init__ (self, Marble.RouteRequest request, Marble.MarbleModel model, QObject parent=0) |
| clear (self) |
QVariant | data (self, QModelIndex index, int role=Qt.DisplayRole) |
bool | deviatedFromRoute (self) |
| exportGpx (self, QIODevice device) |
QVariant | headerData (self, int section, Qt::Orientation orientation, int role=Qt.DisplayRole) |
int | rightNeighbor (self, Marble.GeoDataCoordinates position, RouteRequestconst route) |
Marble.Route | route (self) |
int | rowCount (self, QModelIndex parent=QModelIndex()) |
bool | setCurrentRoute (self, Marble.GeoDataDocument document) |
| updatePosition (self, Marble.GeoDataCoordinates a0, float a1) |
Signal Documentation
A different route was loaded
- Signal syntax:
QObject.connect(source, SIGNAL("currentRouteChanged()"), target_slot)
deviatedFromRoute |
( |
bool |
deviated |
|
) |
|
|
|
returns whether the gps location is on route
- Signal syntax:
QObject.connect(source, SIGNAL("deviatedFromRoute(bool)"), target_slot)
emits a signal regarding information about total time( seconds ) and distance( metres ) remaining to reach destination
- Signal syntax:
QObject.connect(source, SIGNAL("positionChanged()"), target_slot)
Method Documentation
Clear any data held in the model
QVariant data |
( |
self, |
|
|
|
QModelIndex |
index, |
|
|
int |
role=Qt.DisplayRole |
|
) |
|
|
|
Overload of QAbstractListModel
bool deviatedFromRoute |
( |
|
self ) |
|
returns whether the gps location is on route
exportGpx |
( |
self, |
|
|
|
QIODevice |
device |
|
) |
|
|
|
Export waypoints and instructions in gpx format
QVariant headerData |
( |
self, |
|
|
|
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role=Qt.DisplayRole |
|
) |
|
|
|
Overload of QAbstractListModel
Maps points from the provided route request to waypoints in the model
according to their global minimal distance. Returns the right neighbor
(next route request item along the waypoints) of the provided position.
Provided route must not be null.
- Returns:
- -1 If the provided route is empty, the index of the right
neighbor along the waypoints otherwise (result is a valid RouteRequest
index in that case)
int rowCount |
( |
self, |
|
|
|
QModelIndex |
parent=QModelIndex() |
|
) |
|
|
|
Overload of QAbstractListModel
Old data in the model is discarded, the parsed content of the provided document
is used as the new model data and a model reset is done
Enumeration Documentation
- Enumerator:
-
CoordinateRole = Qt::UserRole+3 | |
TurnTypeIconRole | |
LongitudeRole | |
LatitudeRole | |