Commit e1898084 authored by Volker Krause's avatar Volker Krause
Browse files

Add method to check whether we have an absolute platform length

Needed for handling both cases during layouting.
parent e0023062
......@@ -85,6 +85,11 @@ void Platform::setSections(std::vector<PlatformSection> &&sections)
d->sections = std::move(sections);
bool Platform::hasAbsoluteLength() const
return d->length > 1.0;
Platform Platform::merge(const Platform &lhs, const Platform &rhs)
// TODO expand this
......@@ -54,12 +54,19 @@ class KPUBLICTRANSPORT_EXPORT Platform
/** Length of the platform, in meter.
* Value is negative if the information is not available.
* Useful for display scaling from relative platform coordinates.
* @see hasAbsoluteLength
/** Platform sections for consumption by QML. */
Q_PROPERTY(QVariantList sections READ sectionsVariant)
/** @c 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.
Q_PROPERTY(bool hasAbsoluteLength READ hasAbsoluteLength)
/** Returns @c true if this object contains no information beyond default values. */
bool isEmpty() const;
......@@ -71,6 +78,8 @@ public:
/** Sets the platform sections. */
void setSections(std::vector<PlatformSection> &&sections);
bool hasAbsoluteLength() const;
/** Merge two platform instances. */
static Platform merge(const Platform &lhs, const Platform &rhs);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment