Qt 4.8
Public Functions | Public Variables | List of all members
QPainterPath::Element Class Reference

The QPainterPath::Element class specifies the position and type of a subpath. More...

#include <qpainterpath.h>

Public Functions

bool isCurveTo () const
 Returns true if the element is a curve, otherwise returns false. More...
 
bool isLineTo () const
 Returns true if the element is a line, otherwise returns false. More...
 
bool isMoveTo () const
 Returns true if the element is moving the current position, otherwise returns false. More...
 
 operator QPointF () const
 Returns the element's position. More...
 
bool operator!= (const Element &e) const
 Returns true if this element is not equal to other; otherwise returns false. More...
 
bool operator== (const Element &e) const
 Returns true if this element is equal to other; otherwise returns false. More...
 

Public Variables

ElementType type
 the type of element More...
 
qreal x
 the x coordinate of the element's position. More...
 
qreal y
 the y coordinate of the element's position. More...
 

Detailed Description

The QPainterPath::Element class specifies the position and type of a subpath.

Once a QPainterPath object is constructed, subpaths like lines and curves can be added to the path (creating QPainterPath::LineToElement and QPainterPath::CurveToElement components).

The lines and curves stretch from the currentPosition() to the position passed as argument. The currentPosition() of the QPainterPath object is always the end position of the last subpath that was added (or the initial start point). The moveTo() function can be used to move the currentPosition() without adding a line or curve, creating a QPainterPath::MoveToElement component.

See also
QPainterPath

Definition at line 77 of file qpainterpath.h.

Functions

◆ isCurveTo()

bool QPainterPath::Element::isCurveTo ( ) const
inline

Returns true if the element is a curve, otherwise returns false.

See also
type, QPainterPath::CurveToElement

Definition at line 85 of file qpainterpath.h.

Referenced by QGLLineMaskGenerator::generateTrapezoids().

85 { return type == CurveToElement; }
ElementType type
the type of element
Definition: qpainterpath.h:81

◆ isLineTo()

bool QPainterPath::Element::isLineTo ( ) const
inline

Returns true if the element is a line, otherwise returns false.

See also
type, QPainterPath::LineToElement

Definition at line 84 of file qpainterpath.h.

Referenced by QGLLineMaskGenerator::generateTrapezoids(), QPathClipper::pathToRect(), and qt_vg_pathToRect().

84 { return type == LineToElement; }
ElementType type
the type of element
Definition: qpainterpath.h:81

◆ isMoveTo()

bool QPainterPath::Element::isMoveTo ( ) const
inline

Returns true if the element is moving the current position, otherwise returns false.

See also
type, QPainterPath::MoveToElement

Definition at line 83 of file qpainterpath.h.

Referenced by QPathClipper::pathToRect(), and qt_vg_pathToRect().

83 { return type == MoveToElement; }
ElementType type
the type of element
Definition: qpainterpath.h:81

◆ operator QPointF()

QPainterPath::Element::operator QPointF ( ) const
inline

Returns the element's position.

See also
x, y

Definition at line 87 of file qpainterpath.h.

87 { return QPointF(x, y); }
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
qreal y
the y coordinate of the element&#39;s position.
Definition: qpainterpath.h:80
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79

◆ operator!=()

bool QPainterPath::Element::operator!= ( const Element other) const
inline

Returns true if this element is not equal to other; otherwise returns false.

Since
4.2
See also
operator==()

Definition at line 91 of file qpainterpath.h.

91 { return !operator==(e); }
bool operator==(const Element &e) const
Returns true if this element is equal to other; otherwise returns false.
Definition: qpainterpath.h:89

◆ operator==()

bool QPainterPath::Element::operator== ( const Element other) const
inline

Returns true if this element is equal to other; otherwise returns false.

Since
4.2
See also
operator!=()

Definition at line 89 of file qpainterpath.h.

89  { return qFuzzyCompare(x, e.x)
90  && qFuzzyCompare(y, e.y) && type == e.type; }
ElementType type
the type of element
Definition: qpainterpath.h:81
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
Definition: qglobal.h:2030
qreal y
the y coordinate of the element&#39;s position.
Definition: qpainterpath.h:80
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79

Properties

◆ type

QPainterPath::Element::type

◆ x

QPainterPath::Element::x

◆ y

QPainterPath::Element::y

The documentation for this class was generated from the following files: