KPublicTransport::JourneySection
#include <journey.h>
Public Types | |
enum | Mode { Invalid = 0 , PublicTransport = 1 , Transfer = 2 , Walking = 4 , Waiting = 8 , RentedVehicle = 16 , IndividualTransport = 32 } |
typedef QFlags< Mode > | Modes |
Static Public Member Functions | |
static std::vector< JourneySection > | fromJson (const QJsonArray &array) |
static JourneySection | fromJson (const QJsonObject &obj) |
static bool | isSame (const JourneySection &lhs, const JourneySection &rhs) |
static JourneySection | merge (const JourneySection &lhs, const JourneySection &rhs) |
static Q_INVOKABLE QString | modeIconName (KPublicTransport::JourneySection::Mode mode) |
static QJsonObject | toJson (const JourneySection §ion) |
static QJsonArray | toJson (const std::vector< JourneySection > §ions) |
Detailed Description
A segment of a journey plan.
Also used for trips, ie. a single full vehicle run along a route.
This consists of a departure and an arrival stopover as well as zero or more intermediate stopovers. For extracting sub-journeys those can be addresses by a numeric index. Index 0 refers to the departure, 1 to N refer to the n-th intermediate stopover and N + 1 refers to the arrival, for N intermediate stops.
Member Typedef Documentation
◆ Modes
typedef QFlags< Mode > KPublicTransport::JourneySection::Modes |
Member Enumeration Documentation
◆ Mode
Mode of transport.
These categories are fairly coarse, for a more detailed break-down of PublicTransport see Line::Mode.
Property Documentation
◆ arrival
|
readwrite |
◆ arrivalDelay
|
read |
◆ arrivalPlatformChanged
|
read |
◆ arrivalPlatformLayout
|
readwrite |
◆ arrivalVehicleLayout
|
readwrite |
◆ co2Emission
|
readwrite |
COâ‚‚ emission during this journey section, in gram.
In case the backend doesn't provide this value, it is estimated based on the distance travelled during this section and the mode of transport, based on average emission values from https://en.wikipedia.org/wiki/Environmental_impact_of_transport This value can be 0 (e.g. in case of walk or wait sections), or -1 if no information is available.
◆ departure
|
readwrite |
◆ departureDelay
|
read |
◆ departurePlatformChanged
|
read |
◆ departurePlatformLayout
|
readwrite |
◆ departureVehicleLayout
|
readwrite |
◆ disruptionEffect
|
readwrite |
Disruption effect on this section, if any.
◆ distance
|
readwrite |
◆ duration
|
read |
◆ expectedArrivalPlatform
|
readwrite |
◆ expectedArrivalTime
|
readwrite |
◆ expectedDeparturePlatform
|
readwrite |
◆ expectedDepartureTime
|
readwrite |
◆ features
|
read |
◆ from
|
readwrite |
◆ hasExpectedArrivalPlatform
|
read |
◆ hasExpectedArrivalTime
|
read |
◆ hasExpectedDeparturePlatform
|
read |
◆ hasExpectedDepartureTime
|
read |
◆ iconName
|
read |
◆ individualTransport
|
readwrite |
◆ intermediateStops
|
read |
◆ label
|
read |
◆ loadInformation
|
readwrite |
◆ maximumOccupancy
|
read |
◆ mode
|
readwrite |
◆ notes
|
readwrite |
◆ path
|
readwrite |
◆ rentalVehicle
|
readwrite |
◆ route
|
readwrite |
◆ scheduledArrivalPlatform
|
readwrite |
◆ scheduledArrivalTime
|
readwrite |
◆ scheduledDeparturePlatform
|
readwrite |
◆ scheduledDepartureTime
|
readwrite |
◆ to
|
readwrite |
Member Function Documentation
◆ addNote()
void JourneySection::addNote | ( | const QString & | note | ) |
Adds a note.
This will check for duplicates and normalize the notes.
Definition at line 280 of file journey.cpp.
◆ addNotes()
void JourneySection::addNotes | ( | const QStringList & | notes | ) |
Definition at line 290 of file journey.cpp.
◆ applyMetaData()
void JourneySection::applyMetaData | ( | bool | download | ) |
Augment line meta data.
- Parameters
-
download if set to true
, trigger the download of locally missing assets.
Definition at line 732 of file journey.cpp.
◆ arrivalDelay()
|
nodiscard |
Definition at line 130 of file journey.cpp.
◆ arrivalPlatformChanged()
|
nodiscard |
Definition at line 264 of file journey.cpp.
◆ departureDelay()
|
nodiscard |
Definition at line 98 of file journey.cpp.
◆ departurePlatformChanged()
|
nodiscard |
Definition at line 232 of file journey.cpp.
◆ duration()
|
nodiscard |
Definition at line 135 of file journey.cpp.
◆ expectedArrivalPlatform()
|
nodiscard |
Definition at line 248 of file journey.cpp.
◆ expectedArrivalTime()
|
nodiscard |
Definition at line 114 of file journey.cpp.
◆ expectedDeparturePlatform()
|
nodiscard |
Definition at line 216 of file journey.cpp.
◆ expectedDepartureTime()
|
nodiscard |
Definition at line 82 of file journey.cpp.
◆ features()
|
nodiscard |
Vehicle features.
This is identical to departureVehicleLayout.features and provided for convenience for cases where no more detailed vehicle information are available.
Definition at line 512 of file journey.cpp.
◆ fromJson() [1/2]
|
staticnodiscard |
Deserialize a vector of journey sections from JSON.
Definition at line 926 of file journey.cpp.
◆ fromJson() [2/2]
|
staticnodiscard |
Deserialize an object from JSON.
Definition at line 883 of file journey.cpp.
◆ hasExpectedArrivalPlatform()
|
nodiscard |
Definition at line 259 of file journey.cpp.
◆ hasExpectedArrivalTime()
|
nodiscard |
Definition at line 125 of file journey.cpp.
◆ hasExpectedDeparturePlatform()
|
nodiscard |
Definition at line 227 of file journey.cpp.
◆ hasExpectedDepartureTime()
|
nodiscard |
Definition at line 93 of file journey.cpp.
◆ hasIdentifier()
|
nodiscard |
Definition at line 608 of file journey.cpp.
◆ hasIdentifiers()
|
nodiscard |
Returns true
if there is any identifier set at all.
This is usually a prerequisite for efficient trip queries.
Definition at line 619 of file journey.cpp.
◆ iconName()
|
nodiscard |
Definition at line 532 of file journey.cpp.
◆ identifier()
|
nodiscard |
Backend-specific journey section identifiers.
Definition at line 603 of file journey.cpp.
◆ indexOfStopover()
|
nodiscard |
Returns the index of stop
in this journey section.
- Returns
- -1 if
stop
isn't found.
Definition at line 655 of file journey.cpp.
◆ intermediateStops()
|
nodiscard |
Intermediate stop-overs along this journey section.
This does not include the departure and arrival stops, and might be empty on backends not providing this information.
Definition at line 297 of file journey.cpp.
◆ isSame()
|
staticnodiscard |
Checks if two instances refer to the same journey section (which does not necessarily mean they are exactly equal).
Definition at line 750 of file journey.cpp.
◆ label()
|
nodiscard |
Definition at line 574 of file journey.cpp.
◆ loadInformation()
|
nodiscard |
Vehicle load information for this journey section, if available.
Definition at line 440 of file journey.cpp.
◆ maximumOccupancy()
|
nodiscard |
Definition at line 596 of file journey.cpp.
◆ merge()
|
staticnodiscard |
Merge two instances.
This assumes isSame(lhs, rhs) and tries to preserve the most detailed information.
Definition at line 800 of file journey.cpp.
◆ modeIconName()
|
staticnodiscard |
Icon representing the journey section mode mode
.
Can be a qrc: or file: URL or an XDG icon name.
Definition at line 552 of file journey.cpp.
◆ scheduledArrivalPlatform()
|
nodiscard |
Definition at line 237 of file journey.cpp.
◆ scheduledArrivalTime()
|
nodiscard |
Definition at line 103 of file journey.cpp.
◆ scheduledDeparturePlatform()
|
nodiscard |
Definition at line 205 of file journey.cpp.
◆ scheduledDepartureTime()
|
nodiscard |
Definition at line 71 of file journey.cpp.
◆ setExpectedArrivalPlatform()
void JourneySection::setExpectedArrivalPlatform | ( | const QString & | platform | ) |
Definition at line 253 of file journey.cpp.
◆ setExpectedArrivalTime()
void JourneySection::setExpectedArrivalTime | ( | const QDateTime & | value | ) |
Definition at line 119 of file journey.cpp.
◆ setExpectedDeparturePlatform()
void JourneySection::setExpectedDeparturePlatform | ( | const QString & | platform | ) |
Definition at line 221 of file journey.cpp.
◆ setExpectedDepartureTime()
void JourneySection::setExpectedDepartureTime | ( | const QDateTime & | value | ) |
Definition at line 87 of file journey.cpp.
◆ setFeatures()
void JourneySection::setFeatures | ( | std::vector< KPublicTransport::Feature > && | features | ) |
Definition at line 524 of file journey.cpp.
◆ setIdentifier()
Definition at line 613 of file journey.cpp.
◆ setIntermediateStops()
void JourneySection::setIntermediateStops | ( | std::vector< Stopover > && | stops | ) |
Set the intermediate stops.
Definition at line 308 of file journey.cpp.
◆ setLoadInformation()
void JourneySection::setLoadInformation | ( | std::vector< LoadInfo > && | loadInfo | ) |
Set the vehicle load information for this journey section.
Definition at line 445 of file journey.cpp.
◆ setScheduledArrivalPlatform()
void JourneySection::setScheduledArrivalPlatform | ( | const QString & | platform | ) |
Definition at line 242 of file journey.cpp.
◆ setScheduledArrivalTime()
void JourneySection::setScheduledArrivalTime | ( | const QDateTime & | value | ) |
Definition at line 108 of file journey.cpp.
◆ setScheduledDeparturePlatform()
void JourneySection::setScheduledDeparturePlatform | ( | const QString & | platform | ) |
Definition at line 210 of file journey.cpp.
◆ setScheduledDepartureTime()
void JourneySection::setScheduledDepartureTime | ( | const QDateTime & | value | ) |
Definition at line 76 of file journey.cpp.
◆ setStopovver()
void JourneySection::setStopovver | ( | qsizetype | idx, |
const Stopover & | stop ) |
Set the stopover at index idx
.
If idx
is not a valid index nothing is done.
Definition at line 639 of file journey.cpp.
◆ stopover()
|
nodiscard |
Retrieve stopover at index idx
.
Definition at line 624 of file journey.cpp.
◆ subsection()
|
nodiscard |
Returns the sub-journey starting from index begin
until end
(inclusive).
Both begin
and end
have to be valid indices and end
has to be strictly larger than begin
, otherwise an invalid journey section is returned.
Definition at line 669 of file journey.cpp.
◆ takeFeatures()
|
nodiscard |
Definition at line 517 of file journey.cpp.
◆ takeIntermediateStops()
std::vector< Stopover > && JourneySection::takeIntermediateStops | ( | ) |
Moves the intermediate stops out of this object.
Definition at line 302 of file journey.cpp.
◆ toJson() [1/2]
|
staticnodiscard |
Serializes one journey section to JSON.
Definition at line 834 of file journey.cpp.
◆ toJson() [2/2]
|
staticnodiscard |
Serializes a vector of journey sections to JSON.
Definition at line 878 of file journey.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Mar 28 2025 11:50:13 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.