KPublicTransport::Path

Search for usage in LXR

#include <path.h>

Properties

int distance
 
QPointF endPoint
 
int sectionCount
 
std::vector< KPublicTransport::PathSectionsections
 
QPointF startPoint
 

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 112 of file path.h.

Property Documentation

◆ distance

int KPublicTransport::Path::distance
read

The length of this path in meters.

Definition at line 122 of file path.h.

◆ endPoint

QPointF KPublicTransport::Path::endPoint
read

Last point on this path.

Definition at line 127 of file path.h.

◆ sectionCount

int KPublicTransport::Path::sectionCount
read

Number of path sections for QML.

Definition at line 119 of file path.h.

◆ sections

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

Access to path sections for QML.

Definition at line 117 of file path.h.

◆ startPoint

QPointF KPublicTransport::Path::startPoint
read

First point on this path.

Definition at line 125 of file path.h.

Member Function Documentation

◆ distance()

int Path::distance ( ) const
nodiscard

Length of this path in meters.

Definition at line 165 of file path.cpp.

◆ endPoint()

QPointF Path::endPoint ( ) const
nodiscard

Last point on this path.

Definition at line 175 of file path.cpp.

◆ fromJson()

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

Deserialize an object from JSON.

Definition at line 187 of file path.cpp.

◆ isEmpty()

bool Path::isEmpty ( ) const
nodiscard

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

Definition at line 143 of file path.cpp.

◆ sections()

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

The path sections.

Definition at line 148 of file path.cpp.

◆ setSections()

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

Sets the path sections.

Definition at line 159 of file path.cpp.

◆ startPoint()

QPointF Path::startPoint ( ) const
nodiscard

First point on this path.

Definition at line 170 of file path.cpp.

◆ takeSections()

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

Moves the path sections out of this object.

Definition at line 153 of file path.cpp.

◆ toJson()

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

Serializes one path object to JSON.

Definition at line 180 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 Sat Dec 21 2024 16:59:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.