libosmscout  1.1.1
Public Types | Public Slots | Signals | Public Member Functions | Properties | List of all members
osmscout::RoutingListModel Class Reference

#include <libosmscout-client-qt/include/osmscout/RoutingModel.h>

Inheritance diagram for osmscout::RoutingListModel:
Inheritance graph
[legend]
Collaboration diagram for osmscout::RoutingListModel:
Collaboration graph
[legend]

Public Types

using Roles = RouteStep::Roles
 

Public Slots

void setStartAndTarget (LocationEntry *start, LocationEntry *target, QString vehicleStr="car")
 
void setStartAndTarget (LocationEntry *start, LocationEntry *target, QmlRoutingProfile *routingProfile)
 
void clear ()
 
void cancel ()
 
void onRouteComputed (QtRouteData route, int requestId)
 
void onRouteFailed (QString reason, int requestId)
 
void onRoutingProgress (int percent, int requestId)
 

Signals

void routeRequest (LocationEntryRef start, LocationEntryRef target, QmlRoutingProfileRef profile, int requestId, osmscout::BreakerRef breaker)
 
void computingChanged ()
 
void routeFailed (QString reason)
 
void routingProgress (int percent)
 

Public Member Functions

 RoutingListModel (QObject *parent=0)
 
virtual ~RoutingListModel ()
 
QVariant data (const QModelIndex &index, int role) const
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
double getRouteLength () const
 
double getRouteDuration () const
 
Qt::ItemFlags flags (const QModelIndex &index) const
 
QHash< int, QByteArray > roleNames () const
 
Q_INVOKABLE QObject * get (int row) const
 
bool isReady ()
 
Q_INVOKABLE QStringList availableVehicles ()
 
Q_INVOKABLE QObject * locationEntryFromPosition (double lat, double lon, QString label="")
 
QObject * getRoute () const
 
OverlayWaygetRouteWay ()
 

Properties

int count
 
bool ready
 
QObject routeWay
 
QObject route
 
double length
 
double duration
 

Member Typedef Documentation

◆ Roles

Constructor & Destructor Documentation

◆ RoutingListModel()

osmscout::RoutingListModel::RoutingListModel ( QObject *  parent = 0)
explicit

◆ ~RoutingListModel()

virtual osmscout::RoutingListModel::~RoutingListModel ( )
virtual

Member Function Documentation

◆ availableVehicles()

Q_INVOKABLE QStringList osmscout::RoutingListModel::availableVehicles ( )
inline

◆ cancel

void osmscout::RoutingListModel::cancel ( )
slot

◆ clear

void osmscout::RoutingListModel::clear ( )
slot

◆ computingChanged

void osmscout::RoutingListModel::computingChanged ( )
signal

◆ data()

QVariant osmscout::RoutingListModel::data ( const QModelIndex &  index,
int  role 
) const

◆ flags()

Qt::ItemFlags osmscout::RoutingListModel::flags ( const QModelIndex &  index) const

◆ get()

Q_INVOKABLE QObject* osmscout::RoutingListModel::get ( int  row) const

◆ getRoute()

QObject* osmscout::RoutingListModel::getRoute ( ) const
inline

◆ getRouteDuration()

double osmscout::RoutingListModel::getRouteDuration ( ) const

Route duration in seconds

Returns

◆ getRouteLength()

double osmscout::RoutingListModel::getRouteLength ( ) const

Route length in meters

Returns

◆ getRouteWay()

OverlayWay* osmscout::RoutingListModel::getRouteWay ( )
inline

◆ isReady()

bool osmscout::RoutingListModel::isReady ( )
inline

◆ locationEntryFromPosition()

Q_INVOKABLE QObject* osmscout::RoutingListModel::locationEntryFromPosition ( double  lat,
double  lon,
QString  label = "" 
)
inline

Create LocationEntry from geographic coordinate with optional label. It may be used from QML when selecting route start/end via point on map.

◆ onRouteComputed

void osmscout::RoutingListModel::onRouteComputed ( QtRouteData  route,
int  requestId 
)
slot

◆ onRouteFailed

void osmscout::RoutingListModel::onRouteFailed ( QString  reason,
int  requestId 
)
slot

◆ onRoutingProgress

void osmscout::RoutingListModel::onRoutingProgress ( int  percent,
int  requestId 
)
slot

◆ roleNames()

QHash<int, QByteArray> osmscout::RoutingListModel::roleNames ( ) const

◆ routeFailed

void osmscout::RoutingListModel::routeFailed ( QString  reason)
signal

◆ routeRequest

void osmscout::RoutingListModel::routeRequest ( LocationEntryRef  start,
LocationEntryRef  target,
QmlRoutingProfileRef  profile,
int  requestId,
osmscout::BreakerRef  breaker 
)
signal

◆ routingProgress

void osmscout::RoutingListModel::routingProgress ( int  percent)
signal

◆ rowCount()

int osmscout::RoutingListModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const

◆ setStartAndTarget [1/2]

void osmscout::RoutingListModel::setStartAndTarget ( LocationEntry start,
LocationEntry target,
QString  vehicleStr = "car" 
)
slot

◆ setStartAndTarget [2/2]

void osmscout::RoutingListModel::setStartAndTarget ( LocationEntry start,
LocationEntry target,
QmlRoutingProfile routingProfile 
)
slot

Property Documentation

◆ count

int osmscout::RoutingListModel::count
read

◆ duration

double osmscout::RoutingListModel::duration
read

◆ length

double osmscout::RoutingListModel::length
read

◆ ready

bool osmscout::RoutingListModel::ready
read

◆ route

QObject osmscout::RoutingListModel::route
read

◆ routeWay

QObject osmscout::RoutingListModel::routeWay
read

The documentation for this class was generated from the following file: