Qt 4.8
Public Functions | Public Variables | List of all members
QPainterPathData Class Reference

#include <qpainterpath_p.h>

Inheritance diagram for QPainterPathData:
QPainterPathPrivate

Public Functions

void close ()
 
bool isClosed () const
 
void maybeMoveTo ()
 
 QPainterPathData ()
 
 QPainterPathData (const QPainterPathData &other)
 
const QVectorPathvectorPath ()
 
 ~QPainterPathData ()
 

Public Variables

QRectF bounds
 
QRectF controlBounds
 
uint convex: 1
 
int cStart
 
uint dirtyBounds: 1
 
uint dirtyControlBounds: 1
 
Qt::FillRule fillRule
 
QVectorPathConverterpathConverter
 
uint require_moveTo: 1
 

Detailed Description

Definition at line 141 of file qpainterpath_p.h.

Constructors and Destructors

◆ QPainterPathData() [1/2]

QPainterPathData::QPainterPathData ( )
inline

Definition at line 144 of file qpainterpath_p.h.

144  :
145  cStart(0),
147  dirtyBounds(false),
148  dirtyControlBounds(false),
149  pathConverter(0)
150  {
151  ref = 1;
152  require_moveTo = false;
153  convex = false;
154  }
QVectorPathConverter * pathConverter
Qt::FillRule fillRule

◆ QPainterPathData() [2/2]

QPainterPathData::QPainterPathData ( const QPainterPathData other)
inline

Definition at line 156 of file qpainterpath_p.h.

156  :
158  bounds(other.bounds),
160  dirtyBounds(other.dirtyBounds),
162  convex(other.convex),
163  pathConverter(0)
164  {
165  ref = 1;
166  require_moveTo = false;
167  elements = other.elements;
168  }
QVectorPathConverter * pathConverter
Qt::FillRule fillRule
QVector< QPainterPath::Element > elements
Definition: qpainterpath.h:254

◆ ~QPainterPathData()

QPainterPathData::~QPainterPathData ( )
inline

Definition at line 170 of file qpainterpath_p.h.

170  {
171  delete pathConverter;
172  }
QVectorPathConverter * pathConverter

Functions

◆ close()

void QPainterPathData::close ( )
inline

Definition at line 246 of file qpainterpath_p.h.

Referenced by QPainterPath::closeSubpath().

247 {
248  Q_ASSERT(ref == 1);
249  require_moveTo = true;
250  const QPainterPath::Element &first = elements.at(cStart);
252  if (first.x != last.x || first.y != last.y) {
253  if (qFuzzyCompare(first.x, last.x) && qFuzzyCompare(first.y, last.y)) {
254  last.x = first.x;
255  last.y = first.y;
256  } else {
258  elements << e;
259  }
260  }
261 }
The QPainterPath::Element class specifies the position and type of a subpath.
Definition: qpainterpath.h:77
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
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
T & last()
Returns a reference to the last item in the vector.
Definition: qvector.h:262
QVector< QPainterPath::Element > elements
Definition: qpainterpath.h:254
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79

◆ isClosed()

bool QPainterPathData::isClosed ( ) const
inline

Definition at line 239 of file qpainterpath_p.h.

Referenced by QPainterPath::addPath(), and QPainterPath::lineTo().

240 {
241  const QPainterPath::Element &first = elements.at(cStart);
242  const QPainterPath::Element &last = elements.last();
243  return first.x == last.x && first.y == last.y;
244 }
The QPainterPath::Element class specifies the position and type of a subpath.
Definition: qpainterpath.h:77
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
T & last()
Returns a reference to the last item in the vector.
Definition: qvector.h:262
QVector< QPainterPath::Element > elements
Definition: qpainterpath.h:254
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79

◆ maybeMoveTo()

void QPainterPathData::maybeMoveTo ( )
inline

Definition at line 263 of file qpainterpath_p.h.

Referenced by QPainterPath::cubicTo(), and QPainterPath::lineTo().

264 {
265  if (require_moveTo) {
268  elements.append(e);
269  require_moveTo = false;
270  }
271 }
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
void append(const T &t)
Inserts value at the end of the vector.
Definition: qvector.h:573
T & last()
Returns a reference to the last item in the vector.
Definition: qvector.h:262
QVector< QPainterPath::Element > elements
Definition: qpainterpath.h:254

◆ vectorPath()

const QVectorPath& QPainterPathData::vectorPath ( )
inline

Definition at line 178 of file qpainterpath_p.h.

Referenced by qtVectorPathForPath().

178  {
179  if (!pathConverter)
181  return pathConverter->path;
182  }
QVectorPathConverter * pathConverter
Qt::FillRule fillRule
QVector< QPainterPath::Element > elements
Definition: qpainterpath.h:254

Properties

◆ bounds

QRectF QPainterPathData::bounds

◆ controlBounds

QRectF QPainterPathData::controlBounds

◆ convex

uint QPainterPathData::convex

◆ cStart

int QPainterPathData::cStart

◆ dirtyBounds

uint QPainterPathData::dirtyBounds

◆ dirtyControlBounds

uint QPainterPathData::dirtyControlBounds

◆ fillRule

Qt::FillRule QPainterPathData::fillRule

◆ pathConverter

QVectorPathConverter* QPainterPathData::pathConverter

Definition at line 195 of file qpainterpath_p.h.

◆ require_moveTo

uint QPainterPathData::require_moveTo

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