KPublicTransport::Platform
#include <platform.h>
Properties | |
| bool | hasAbsoluteLength |
| int | length |
| QString | name |
| QVariantList | sections |
Public Member Functions | |
| bool | hasAbsoluteLength () const |
| bool | isEmpty () const |
| const std::vector< PlatformSection > & | sections () const |
| void | setSections (std::vector< PlatformSection > &§ions) |
| std::vector< PlatformSection > && | takeSections () |
Static Public Member Functions | |
| static std::vector< Platform > | fromJson (const QJsonArray &array) |
| static Platform | fromJson (const QJsonObject &obj) |
| static Platform | merge (const Platform &lhs, const Platform &rhs) |
| static QJsonObject | toJson (const Platform &platform) |
| static QJsonArray | toJson (const std::vector< Platform > &platforms) |
Detailed Description
Information about the layout of a station platform.
Definition at line 44 of file platform.h.
Property Documentation
◆ hasAbsoluteLength
|
read |
true if the absolute length of the platform in meter is known.
A platform can have a positive length if proportional section sizes are known, but the absolute length is unknown.
Definition at line 68 of file platform.h.
◆ length
|
readwrite |
Length of the platform, in meter.
Value is negative if the information is not available. Useful for display scaling from relative platform coordinates.
- See also
- hasAbsoluteLength
Definition at line 59 of file platform.h.
◆ name
|
readwrite |
Human readable identifier of this platform.
Typically a number.
Definition at line 52 of file platform.h.
◆ sections
|
read |
Platform sections for consumption by QML.
Definition at line 62 of file platform.h.
Member Function Documentation
◆ fromJson() [1/2]
|
static |
Deserialize an array from JSON.
Definition at line 120 of file platform.cpp.
◆ fromJson() [2/2]
|
static |
Deserialize an object from JSON.
Definition at line 113 of file platform.cpp.
◆ hasAbsoluteLength()
| bool Platform::hasAbsoluteLength | ( | ) | const |
Definition at line 88 of file platform.cpp.
◆ isEmpty()
| bool Platform::isEmpty | ( | ) | const |
Returns true if this object contains no information beyond default values.
Definition at line 66 of file platform.cpp.
◆ merge()
Merge two platform instances.
Definition at line 93 of file platform.cpp.
◆ sections()
| const std::vector< PlatformSection > & Platform::sections | ( | ) | const |
The platform sections.
Definition at line 71 of file platform.cpp.
◆ setSections()
| void Platform::setSections | ( | std::vector< PlatformSection > && | sections | ) |
Sets the platform sections.
Definition at line 82 of file platform.cpp.
◆ takeSections()
| std::vector< PlatformSection > && Platform::takeSections | ( | ) |
Moves the platform sections out of this object.
Definition at line 76 of file platform.cpp.
◆ toJson() [1/2]
|
static |
Serializes one platform object to JSON.
Definition at line 99 of file platform.cpp.
◆ toJson() [2/2]
|
static |
Serializes a vector of platform objects to JSON.
Definition at line 108 of file platform.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:52:26 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.