C
PathDataSegment Class
class Qul::PlatformInterface::PathDataSegmentRepresents a single path data segment of the Qul::PlatformInterface::PathData class. More...
Header: | #include <platforminterface/pathdata.h> |
Since: | Qt Quick Ultralite (Platform) 1.8 |
Inherited By: | Qul::PlatformInterface::PathDataArcSegment, Qul::PlatformInterface::PathDataCubicBezierSegment, Qul::PlatformInterface::PathDataLineSegment, Qul::PlatformInterface::PathDataMoveSegment, Qul::PlatformInterface::PathDataPathSeparatorSegment, and Qul::PlatformInterface::PathDataQuadraticBezierSegment |
Public Functions
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.
Example:
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 = segment.as<Qul::PlatformInterface::PathDataCubicBezierSegment>(); }
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.