Qt 4.8
Public Functions | Public Variables | List of all members
QVectorPathConverter::QVectorPathData Struct Reference

#include <qpainterpath_p.h>

Public Functions

 QVectorPathData (const QVector< QPainterPath::Element > &path, uint fillRule, bool convex)
 

Public Variables

QVarLengthArray< QPainterPath::ElementTypeelements
 
uint flags
 
QVarLengthArray< qrealpoints
 

Detailed Description

Definition at line 93 of file qpainterpath_p.h.

Constructors and Destructors

◆ QVectorPathData()

QVectorPathConverter::QVectorPathData::QVectorPathData ( const QVector< QPainterPath::Element > &  path,
uint  fillRule,
bool  convex 
)
inline

Definition at line 94 of file qpainterpath_p.h.

95  : elements(path.size()),
96  points(path.size() * 2),
97  flags(0)
98  {
99  int ptsPos = 0;
100  bool isLines = true;
101  for (int i=0; i<path.size(); ++i) {
102  const QPainterPath::Element &e = path.at(i);
103  elements[i] = e.type;
104  points[ptsPos++] = e.x;
105  points[ptsPos++] = e.y;
108 
109  // This is to check if the path contains only alternating lineTo/moveTo,
110  // in which case we can set the LinesHint in the path. MoveTo is 0 and
111  // LineTo is 1 so the i%2 gets us what we want cheaply.
112  isLines = isLines && e.type == (QPainterPath::ElementType) (i%2);
113  }
114 
115  if (fillRule == Qt::WindingFill)
117  else
119 
120  if (isLines)
122  else {
124  if (!convex)
126  }
127 
128  }
ElementType type
the type of element
Definition: qpainterpath.h:81
The QPainterPath::Element class specifies the position and type of a subpath.
Definition: qpainterpath.h:77
ElementType
This enum describes the types of elements used to connect vertices in subpaths.
Definition: qpainterpath.h:70
QVarLengthArray< QPainterPath::ElementType > elements
qreal y
the y coordinate of the element&#39;s position.
Definition: qpainterpath.h:80
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

Properties

◆ elements

QVarLengthArray<QPainterPath::ElementType> QVectorPathConverter::QVectorPathData::elements

Definition at line 129 of file qpainterpath_p.h.

◆ flags

uint QVectorPathConverter::QVectorPathData::flags

Definition at line 131 of file qpainterpath_p.h.

◆ points

QVarLengthArray<qreal> QVectorPathConverter::QVectorPathData::points

Definition at line 130 of file qpainterpath_p.h.


The documentation for this struct was generated from the following file: