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
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
|
read |
◆ 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
|
read |
◆ 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 217 of file journey.cpp.
◆ addNotes()
void JourneySection::addNotes | ( | const QStringList & | notes | ) |
Definition at line 227 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 553 of file journey.cpp.
◆ arrival()
|
nodiscard |
Returns the arrival stopover of this journey section.
This is the same information as accessible by individual properties, so this is mainly useful if you have to interface with code expecting a Stopover object.
Definition at line 289 of file journey.cpp.
◆ arrivalDelay()
|
nodiscard |
Definition at line 108 of file journey.cpp.
◆ arrivalPlatformChanged()
|
nodiscard |
Definition at line 212 of file journey.cpp.
◆ departure()
|
nodiscard |
Returns the departure stopover of this journey section.
This is the same information as accessible by individual properties, so this is mainly useful if you have to interface with code expecting a Stopover object.
Definition at line 259 of file journey.cpp.
◆ departureDelay()
|
nodiscard |
Definition at line 95 of file journey.cpp.
◆ departurePlatformChanged()
|
nodiscard |
Definition at line 180 of file journey.cpp.
◆ duration()
|
nodiscard |
Definition at line 116 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 450 of file journey.cpp.
◆ fromJson() [1/2]
|
staticnodiscard |
Deserialize a vector of journey sections from JSON.
Definition at line 755 of file journey.cpp.
◆ fromJson() [2/2]
|
staticnodiscard |
Deserialize an object from JSON.
Definition at line 735 of file journey.cpp.
◆ hasExpectedArrivalPlatform()
|
nodiscard |
Definition at line 207 of file journey.cpp.
◆ hasExpectedArrivalTime()
|
nodiscard |
Definition at line 103 of file journey.cpp.
◆ hasExpectedDeparturePlatform()
|
nodiscard |
Definition at line 175 of file journey.cpp.
◆ hasExpectedDepartureTime()
|
nodiscard |
Definition at line 90 of file journey.cpp.
◆ hasIdentifier()
|
nodiscard |
Definition at line 542 of file journey.cpp.
◆ iconName()
|
nodiscard |
Definition at line 466 of file journey.cpp.
◆ identifier()
|
nodiscard |
Backend-specific journey section identifiers.
Definition at line 537 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 234 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 568 of file journey.cpp.
◆ label()
|
nodiscard |
Definition at line 508 of file journey.cpp.
◆ loadInformation()
|
nodiscard |
Vehicle load information for this journey section, if available.
Definition at line 418 of file journey.cpp.
◆ maximumOccupancy()
|
nodiscard |
Definition at line 530 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 618 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 486 of file journey.cpp.
◆ setArrival()
void JourneySection::setArrival | ( | const Stopover & | arrival | ) |
Sets all arrival properties from a given Stopover.
This effects location and time, but doesn't modify intermediate stops or paths.
Definition at line 304 of file journey.cpp.
◆ setDeparture()
void JourneySection::setDeparture | ( | const Stopover & | departure | ) |
Sets all departure properties from a given Stopover.
This effects location and time, but doesn't modify intermediate stops or paths.
Definition at line 275 of file journey.cpp.
◆ setFeatures()
void JourneySection::setFeatures | ( | std::vector< KPublicTransport::Feature > && | features | ) |
Definition at line 460 of file journey.cpp.
◆ setIdentifier()
Definition at line 547 of file journey.cpp.
◆ setIntermediateStops()
void JourneySection::setIntermediateStops | ( | std::vector< Stopover > && | stops | ) |
Set the intermediate stops.
Definition at line 245 of file journey.cpp.
◆ setLoadInformation()
void JourneySection::setLoadInformation | ( | std::vector< LoadInfo > && | loadInfo | ) |
Set the vehicle load information for this journey section.
Definition at line 429 of file journey.cpp.
◆ takeFeatures()
|
nodiscard |
Definition at line 455 of file journey.cpp.
◆ takeIntermediateStops()
std::vector< Stopover > && JourneySection::takeIntermediateStops | ( | ) |
Moves the intermediate stops out of this object.
Definition at line 239 of file journey.cpp.
◆ takeLoadInformation()
std::vector< LoadInfo > && JourneySection::takeLoadInformation | ( | ) |
Moves the load information out of this object for modification.
Definition at line 423 of file journey.cpp.
◆ toJson() [1/2]
|
staticnodiscard |
Serializes one journey section to JSON.
Definition at line 668 of file journey.cpp.
◆ toJson() [2/2]
|
staticnodiscard |
Serializes a vector of journey sections to JSON.
Definition at line 730 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 Jan 24 2025 11:50:52 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.