KPublicTransport::Path

Search for usage in LXR

#include <path.h>

Properties

int distance
 
int sectionCount
 
std::vector< KPublicTransport::PathSectionsections
 

Public Member Functions

int distance () const
 
QPointF endPoint () const
 
bool isEmpty () const
 
const std::vector< PathSection > & sections () const
 
void setSections (std::vector< PathSection > &&sections)
 
QPointF startPoint () const
 
std::vector< PathSection > && takeSections ()
 

Static Public Member Functions

static Path fromJson (const QJsonObject &obj)
 
static QJsonObject toJson (const Path &path)
 

Detailed Description

A path followed by any kind of location change.

This can be the way a train or bus takes, routing instructions for taking a rental vehicle, or instructions for transferring at a train station.

A path consists of one or more PathSection.

Definition at line 88 of file path.h.

Property Documentation

◆ distance

int KPublicTransport::Path::distance
read

The length of this path in meters.

Definition at line 98 of file path.h.

◆ sectionCount

int KPublicTransport::Path::sectionCount
read

Number of path sections for QML.

Definition at line 95 of file path.h.

◆ sections

std::vector<KPublicTransport::PathSection> KPublicTransport::Path::sections
read

Access to path sections for QML.

Definition at line 93 of file path.h.

Member Function Documentation

◆ distance()

int Path::distance ( ) const

Length of this path in meters.

Definition at line 131 of file path.cpp.

◆ endPoint()

QPointF Path::endPoint ( ) const

Last point on this path.

Definition at line 141 of file path.cpp.

◆ fromJson()

Path Path::fromJson ( const QJsonObject & obj)
static

Deserialize an object from JSON.

Definition at line 153 of file path.cpp.

◆ isEmpty()

bool Path::isEmpty ( ) const

Returns true if this is an empty/not-set path.

Definition at line 109 of file path.cpp.

◆ sections()

const std::vector< PathSection > & Path::sections ( ) const

The path sections.

Definition at line 114 of file path.cpp.

◆ setSections()

void Path::setSections ( std::vector< PathSection > && sections)

Sets the path sections.

Definition at line 125 of file path.cpp.

◆ startPoint()

QPointF Path::startPoint ( ) const

First point on this path.

Definition at line 136 of file path.cpp.

◆ takeSections()

std::vector< PathSection > && Path::takeSections ( )

Moves the path sections out of this object.

Definition at line 119 of file path.cpp.

◆ toJson()

QJsonObject Path::toJson ( const Path & path)
static

Serializes one path object to JSON.

Definition at line 146 of file path.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.