Search for usage in LXR

KPublicTransport::Route Class Reference

#include <line.h>


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 124 of file line.h.

Property Documentation

◆ destination

KPublicTransport::Location KPublicTransport::Route::destination

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 139 of file line.h.

◆ direction

QString Route::direction

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 134 of file line.h.

◆ line

KPublicTransport::Line KPublicTransport::Route::line

Line this route belongs to.

Definition at line 128 of file line.h.

◆ name

QString KPublicTransport::Route::name

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

Definition at line 147 of file line.h.

Member Function Documentation

◆ fromJson()

Route Route::fromJson ( const QJsonObject & obj)

Deserialize an object from JSON.

Definition at line 224 of file line.cpp.

◆ isSame()

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

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

Definition at line 191 of file line.cpp.

◆ merge()

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

Merge two Route instances.

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

Definition at line 201 of file line.cpp.

◆ toJson()

QJsonObject Route::toJson ( const Route & r)

Serializes one object to JSON.

Definition at line 211 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 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.