KPublicTransport::Platform

Search for usage in LXR

#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 > &&sections)
 
std::vector< PlatformSection > && takeSections ()
 

Static Public Member Functions

static std::vector< PlatformfromJson (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

bool KPublicTransport::Platform::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

int KPublicTransport::Platform::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

QString KPublicTransport::Platform::name
readwrite

Human readable identifier of this platform.

Typically a number.

Definition at line 52 of file platform.h.

◆ sections

QVariantList KPublicTransport::Platform::sections
read

Platform sections for consumption by QML.

Definition at line 62 of file platform.h.

Member Function Documentation

◆ fromJson() [1/2]

std::vector< Platform > Platform::fromJson ( const QJsonArray & array)
static

Deserialize an array from JSON.

Definition at line 120 of file platform.cpp.

◆ fromJson() [2/2]

Platform Platform::fromJson ( const QJsonObject & obj)
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()

Platform Platform::merge ( const Platform & lhs,
const Platform & rhs )
static

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]

QJsonObject Platform::toJson ( const Platform & platform)
static

Serializes one platform object to JSON.

Definition at line 99 of file platform.cpp.

◆ toJson() [2/2]

QJsonArray Platform::toJson ( const std::vector< Platform > & platforms)
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:
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.