PathDataSegment Class

class Qul::PlatformInterface::PathDataSegment

Represents a single path data segment of the Qul::PlatformInterface::PathData class. More...

Public Functions

const T *as() const
PathData::SegmentType type() const

Detailed Description

After querying the segment type using the type() function the path data segment can be down-casted to the corresponding sub-class by using the as() template function.


Qul::PlatformInterface::PathDataIterator it(pathData);
Qul::PlatformInterface::PathDataSegment segment = it.next();
if (segment.type() == Qul::PathData::CubicBezierSegment) {
    // This down-cast is now safe
    const Qul::PlatformInterface::PathDataCubicBezierSegment *cubic =

Member Function Documentation

template <typename T> const T *PathDataSegment::as() const

Down-casts the path data segment to a corresponding sub-class.

If the sub-class doesn't correspond to the path data segment type then NULL will be returned.

PathData::SegmentType PathDataSegment::type() const

Returns the type of the path data segment.

Available under certain Qt licenses.
Find out more.