Qt 4.8
Properties | Friends | List of all members
QPainterPathPrivate Class Reference

#include <qpainterpath.h>

Inheritance diagram for QPainterPathPrivate:
QPainterPathData

Properties

QVector< QPainterPath::Elementelements
 
QAtomicInt ref
 

Friends

Q_GUI_EXPORT QDataStreamoperator<< (QDataStream &, const QPainterPath &)
 
Q_GUI_EXPORT QDataStreamoperator>> (QDataStream &, QPainterPath &)
 
class QMatrix
 
class QPainterPath
 
class QPainterPathData
 
struct QPainterPathPrivateDeleter
 
class QPainterPathStroker
 
class QPainterPathStrokerPrivate
 
class QTransform
 
class QVectorPath
 

Detailed Description

Definition at line 237 of file qpainterpath.h.

Friends and Related Functions

◆ operator<<

Q_GUI_EXPORT QDataStream& operator<< ( QDataStream ,
const QPainterPath  
)
friend

Definition at line 2509 of file qpainterpath.cpp.

2510 {
2511  if (p.isEmpty()) {
2512  s << 0;
2513  return s;
2514  }
2515 
2516  s << p.elementCount();
2517  for (int i=0; i < p.d_func()->elements.size(); ++i) {
2518  const QPainterPath::Element &e = p.d_func()->elements.at(i);
2519  s << int(e.type);
2520  s << double(e.x) << double(e.y);
2521  }
2522  s << p.d_func()->cStart;
2523  s << int(p.d_func()->fillRule);
2524  return s;
2525 }
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
bool isEmpty() const
Returns true if either there are no elements in this path, or if the only element is a MoveToElement;...
Definition: qpainterpath.h:392
qreal y
the y coordinate of the element&#39;s position.
Definition: qpainterpath.h:80
QPainterPathData * d_func() const
Definition: qpainterpath.h:221
Qt::FillRule fillRule
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79
int elementCount() const
Returns the number of path elements in the painter path.
Definition: qpainterpath.h:397

◆ operator>>

Q_GUI_EXPORT QDataStream& operator>> ( QDataStream ,
QPainterPath  
)
friend

Definition at line 2539 of file qpainterpath.cpp.

2540 {
2541  int size;
2542  s >> size;
2543 
2544  if (size == 0)
2545  return s;
2546 
2547  p.ensureData(); // in case if p.d_func() == 0
2548  if (p.d_func()->elements.size() == 1) {
2549  Q_ASSERT(p.d_func()->elements.at(0).type == QPainterPath::MoveToElement);
2550  p.d_func()->elements.clear();
2551  }
2552  p.d_func()->elements.reserve(p.d_func()->elements.size() + size);
2553  for (int i=0; i<size; ++i) {
2554  int type;
2555  double x, y;
2556  s >> type;
2557  s >> x;
2558  s >> y;
2559  Q_ASSERT(type >= 0 && type <= 3);
2560  if (!qt_is_finite(x) || !qt_is_finite(y)) {
2561 #ifndef QT_NO_DEBUG
2562  qWarning("QDataStream::operator>>: NaN or Inf element found in path, skipping it");
2563 #endif
2564  continue;
2565  }
2567  p.d_func()->elements.append(elm);
2568  }
2569  s >> p.d_func()->cStart;
2570  int fillRule;
2571  s >> fillRule;
2572  Q_ASSERT(fillRule == Qt::OddEvenFill || Qt::WindingFill);
2573  p.d_func()->fillRule = Qt::FillRule(fillRule);
2574  p.d_func()->dirtyBounds = true;
2575  p.d_func()->dirtyControlBounds = true;
2576  return s;
2577 }
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
int type
Definition: qmetatype.cpp:239
double qreal
Definition: qglobal.h:1193
FillRule
Definition: qnamespace.h:1485
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void ensureData()
Definition: qpainterpath.h:213
QPainterPathData * d_func() const
Definition: qpainterpath.h:221
Q_CORE_EXPORT void qWarning(const char *,...)
Qt::FillRule fillRule
static bool qt_is_finite(double d)
Definition: qnumeric_p.h:197

◆ QMatrix

friend class QMatrix
friend

Definition at line 244 of file qpainterpath.h.

◆ QPainterPath

friend class QPainterPath
friend

Definition at line 240 of file qpainterpath.h.

◆ QPainterPathData

friend class QPainterPathData
friend

Definition at line 241 of file qpainterpath.h.

◆ QPainterPathPrivateDeleter

friend struct QPainterPathPrivateDeleter
friend

Definition at line 247 of file qpainterpath.h.

◆ QPainterPathStroker

friend class QPainterPathStroker
friend

Definition at line 242 of file qpainterpath.h.

◆ QPainterPathStrokerPrivate

Definition at line 243 of file qpainterpath.h.

◆ QTransform

friend class QTransform
friend

Definition at line 245 of file qpainterpath.h.

◆ QVectorPath

friend class QVectorPath
friend

Definition at line 246 of file qpainterpath.h.

Properties

◆ elements

QVector<QPainterPath::Element> QPainterPathPrivate::elements
private

◆ ref

QAtomicInt QPainterPathPrivate::ref
private

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