KPublicTransport::Route

Search for usage in LXR

KPublicTransport::Route Class Reference

#include <line.h>

Properties

KPublicTransport::Location destination
 
QString direction
 
KPublicTransport::Line line
 
QString name
 

Static Public Member Functions

static Route fromJson (const QJsonObject &obj)
 
static bool isSame (const Route &lhs, const Route &rhs)
 
static Route merge (const Route &lhs, const Route &rhs)
 
static QJsonObject toJson (const Route &r)
 

Detailed Description

A route of a public transport line.

Definition at line 147 of file line.h.

Property Documentation

◆ destination

KPublicTransport::Location KPublicTransport::Route::destination
readwrite

Destination of the route.

If this is set it should match the direction of the line. Circular lines for example do not have a destination location though.

Definition at line 162 of file line.h.

◆ direction

QString Route::direction
readwrite

Direction of the route.

The direction of the the route is what is displayed on front of a train for example. For directional lines it matches the destination. For circular lines there is no destination however, the direction is then clockwise" for example.

Definition at line 157 of file line.h.

◆ line

KPublicTransport::Line KPublicTransport::Route::line
readwrite

Line this route belongs to.

Definition at line 151 of file line.h.

◆ name

QString KPublicTransport::Route::name
readwrite

Name of the route.

This is not to be confused with the name of the line, which is the much more commonly used value. Use this only if both are in use and you know which one is which, otherwise default to the line name.

See also
Line::name.

Definition at line 170 of file line.h.

Member Function Documentation

◆ fromJson()

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

Deserialize an object from JSON.

Definition at line 299 of file line.cpp.

◆ isSame()

bool Route::isSame ( const Route & lhs,
const Route & rhs )
staticnodiscard

Checks if to instances refer to the same route (which does not necessarily mean they are exactly equal).

Definition at line 266 of file line.cpp.

◆ merge()

Route Route::merge ( const Route & lhs,
const Route & rhs )
staticnodiscard

Merge two Route instances.

This assumes isSame(lhs, rhs) and tries to preserve the most detailed information.

Definition at line 276 of file line.cpp.

◆ toJson()

QJsonObject Route::toJson ( const Route & r)
staticnodiscard

Serializes one object to JSON.

Definition at line 286 of file line.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 Fri Dec 27 2024 11:49:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.