QPainterPath Class Reference

QPainterPath Class Reference

#include <qpainterpath.h>

Class Description

Definition at line 67 of file qpainterpath.h.

Classes

class  Element
 

Public Types

enum  ElementType { MoveToElement, LineToElement, CurveToElement, CurveToDataElement }
 

Public Member Functions

 QPainterPath ()
 
 QPainterPath (const QPointF &startPoint)
 
 QPainterPath (const QPainterPath &other)
 
QPainterPathoperator= (const QPainterPath &other)
 
 ~QPainterPath ()
 
void swap (QPainterPath &other)
 
void closeSubpath ()
 
void moveTo (const QPointF &p)
 
void moveTo (qreal x, qreal y)
 
void lineTo (const QPointF &p)
 
void lineTo (qreal x, qreal y)
 
void arcMoveTo (const QRectF &rect, qreal angle)
 
void arcMoveTo (qreal x, qreal y, qreal w, qreal h, qreal angle)
 
void arcTo (const QRectF &rect, qreal startAngle, qreal arcLength)
 
void arcTo (qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal arcLength)
 
void cubicTo (const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt)
 
void cubicTo (qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty)
 
void quadTo (const QPointF &ctrlPt, const QPointF &endPt)
 
void quadTo (qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)
 
QPointF currentPosition () const
 
void addRect (const QRectF &rect)
 
void addRect (qreal x, qreal y, qreal w, qreal h)
 
void addEllipse (const QRectF &rect)
 
void addEllipse (qreal x, qreal y, qreal w, qreal h)
 
void addEllipse (const QPointF &center, qreal rx, qreal ry)
 
void addPolygon (const QPolygonF &polygon)
 
void addText (const QPointF &point, const QFont &f, const QString &text)
 
void addText (qreal x, qreal y, const QFont &f, const QString &text)
 
void addPath (const QPainterPath &path)
 
void addRegion (const QRegion &region)
 
void addRoundedRect (const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
 
void addRoundedRect (qreal x, qreal y, qreal w, qreal h, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
 
void addRoundRect (const QRectF &rect, int xRnd, int yRnd)
 
void addRoundRect (qreal x, qreal y, qreal w, qreal h, int xRnd, int yRnd)
 
void addRoundRect (const QRectF &rect, int roundness)
 
void addRoundRect (qreal x, qreal y, qreal w, qreal h, int roundness)
 
void connectPath (const QPainterPath &path)
 
bool contains (const QPointF &pt) const
 
bool contains (const QRectF &rect) const
 
bool intersects (const QRectF &rect) const
 
void translate (qreal dx, qreal dy)
 
void translate (const QPointF &offset)
 
QPainterPath translated (qreal dx, qreal dy) const
 
QPainterPath translated (const QPointF &offset) const
 
QRectF boundingRect () const
 
QRectF controlPointRect () const
 
Qt::FillRule fillRule () const
 
void setFillRule (Qt::FillRule fillRule)
 
bool isEmpty () const
 
QPainterPath toReversed () const
 
QList< QPolygonFtoSubpathPolygons (const QMatrix &matrix=QMatrix()) const
 
QList< QPolygonFtoFillPolygons (const QMatrix &matrix=QMatrix()) const
 
QPolygonF toFillPolygon (const QMatrix &matrix=QMatrix()) const
 
QList< QPolygonFtoSubpathPolygons (const QTransform &matrix) const
 
QList< QPolygonFtoFillPolygons (const QTransform &matrix) const
 
QPolygonF toFillPolygon (const QTransform &matrix) const
 
int elementCount () const
 
const QPainterPath::ElementelementAt (int i) const
 
void setElementPositionAt (int i, qreal x, qreal y)
 
qreal length () const
 
qreal percentAtLength (qreal t) const
 
QPointF pointAtPercent (qreal t) const
 
qreal angleAtPercent (qreal t) const
 
qreal slopeAtPercent (qreal t) const
 
bool intersects (const QPainterPath &p) const
 
bool contains (const QPainterPath &p) const
 
QPainterPath united (const QPainterPath &r) const
 
QPainterPath intersected (const QPainterPath &r) const
 
QPainterPath subtracted (const QPainterPath &r) const
 
QPainterPath subtractedInverted (const QPainterPath &r) const
 
QPainterPath simplified () const
 
bool operator== (const QPainterPath &other) const
 
bool operator!= (const QPainterPath &other) const
 
QPainterPath operator& (const QPainterPath &other) const
 
QPainterPath operator| (const QPainterPath &other) const
 
QPainterPath operator+ (const QPainterPath &other) const
 
QPainterPath operator- (const QPainterPath &other) const
 
QPainterPathoperator&= (const QPainterPath &other)
 
QPainterPathoperator|= (const QPainterPath &other)
 
QPainterPathoperator+= (const QPainterPath &other)
 
QPainterPathoperator-= (const QPainterPath &other)
 

Friends

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

Member Enumeration Documentation

Enumerator
MoveToElement 
LineToElement 
CurveToElement 
CurveToDataElement 

Definition at line 70 of file qpainterpath.h.

Constructor & Destructor Documentation

QPainterPath ( const QPointF startPoint)
explicit
QPainterPath ( const QPainterPath other)

Member Function Documentation

QPainterPath& operator= ( const QPainterPath other)
void swap ( QPainterPath other)
inline

Definition at line 103 of file qpainterpath.h.

103 { d_ptr.swap(other.d_ptr); }
void swap(QScopedPointer< T, Cleanup > &other)
void closeSubpath ( )
void moveTo ( const QPointF p)
void moveTo ( qreal  x,
qreal  y 
)
inline

Definition at line 303 of file qpainterpath.h.

304 {
305  moveTo(QPointF(x, y));
306 }
GLenum GLint GLint y
Definition: GLee.h:876
GLenum GLint x
Definition: GLee.h:876
void moveTo(const QPointF &p)
void lineTo ( const QPointF p)
void lineTo ( qreal  x,
qreal  y 
)
inline

Definition at line 308 of file qpainterpath.h.

309 {
310  lineTo(QPointF(x, y));
311 }
GLenum GLint GLint y
Definition: GLee.h:876
void lineTo(const QPointF &p)
GLenum GLint x
Definition: GLee.h:876
void arcMoveTo ( const QRectF rect,
qreal  angle 
)
void arcMoveTo ( qreal  x,
qreal  y,
qreal  w,
qreal  h,
qreal  angle 
)
inline

Definition at line 318 of file qpainterpath.h.

319 {
320  arcMoveTo(QRectF(x, y, w, h), angle);
321 }
GLenum GLint GLint y
Definition: GLee.h:876
GLenum GLint x
Definition: GLee.h:876
Definition: qrect.h:511
int int int int int int h
Definition: GLee.h:10534
void arcMoveTo(const QRectF &rect, qreal angle)
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
void arcTo ( const QRectF rect,
qreal  startAngle,
qreal  arcLength 
)
void arcTo ( qreal  x,
qreal  y,
qreal  w,
qreal  h,
qreal  startAngle,
qreal  arcLength 
)
inline

Definition at line 313 of file qpainterpath.h.

314 {
315  arcTo(QRectF(x, y, w, h), startAngle, arcLength);
316 }
GLenum GLint GLint y
Definition: GLee.h:876
GLenum GLint x
Definition: GLee.h:876
void arcTo(const QRectF &rect, qreal startAngle, qreal arcLength)
Definition: qrect.h:511
int int int int int int h
Definition: GLee.h:10534
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
void cubicTo ( const QPointF ctrlPt1,
const QPointF ctrlPt2,
const QPointF endPt 
)
void cubicTo ( qreal  ctrlPt1x,
qreal  ctrlPt1y,
qreal  ctrlPt2x,
qreal  ctrlPt2y,
qreal  endPtx,
qreal  endPty 
)
inline

Definition at line 323 of file qpainterpath.h.

325 {
326  cubicTo(QPointF(ctrlPt1x, ctrlPt1y), QPointF(ctrlPt2x, ctrlPt2y),
327  QPointF(endPtx, endPty));
328 }
void cubicTo(const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt)
void quadTo ( const QPointF ctrlPt,
const QPointF endPt 
)
void quadTo ( qreal  ctrlPtx,
qreal  ctrlPty,
qreal  endPtx,
qreal  endPty 
)
inline

Definition at line 330 of file qpainterpath.h.

331 {
332  quadTo(QPointF(ctrlPtx, ctrlPty), QPointF(endPtx, endPty));
333 }
void quadTo(const QPointF &ctrlPt, const QPointF &endPt)
QPointF currentPosition ( ) const
void addRect ( const QRectF rect)
void addRect ( qreal  x,
qreal  y,
qreal  w,
qreal  h 
)
inline

Definition at line 345 of file qpainterpath.h.

346 {
347  addRect(QRectF(x, y, w, h));
348 }
GLenum GLint GLint y
Definition: GLee.h:876
GLenum GLint x
Definition: GLee.h:876
Definition: qrect.h:511
int int int int int int h
Definition: GLee.h:10534
void addRect(const QRectF &rect)
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
void addEllipse ( const QRectF rect)
void addEllipse ( qreal  x,
qreal  y,
qreal  w,
qreal  h 
)
inline

Definition at line 335 of file qpainterpath.h.

336 {
337  addEllipse(QRectF(x, y, w, h));
338 }
GLenum GLint GLint y
Definition: GLee.h:876
GLenum GLint x
Definition: GLee.h:876
void addEllipse(const QRectF &rect)
Definition: qrect.h:511
int int int int int int h
Definition: GLee.h:10534
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
void addEllipse ( const QPointF center,
qreal  rx,
qreal  ry 
)
inline

Definition at line 340 of file qpainterpath.h.

341 {
342  addEllipse(QRectF(center.x() - rx, center.y() - ry, 2 * rx, 2 * ry));
343 }
qreal y() const
Definition: qpoint.h:287
void addEllipse(const QRectF &rect)
qreal x() const
Definition: qpoint.h:282
Definition: qrect.h:511
void addPolygon ( const QPolygonF polygon)
void addText ( const QPointF point,
const QFont f,
const QString text 
)
void addText ( qreal  x,
qreal  y,
const QFont f,
const QString text 
)
inline

Definition at line 381 of file qpainterpath.h.

382 {
383  addText(QPointF(x, y), f, text);
384 }
GLenum GLint GLint y
Definition: GLee.h:876
void addText(const QPointF &point, const QFont &f, const QString &text)
GLenum GLint x
Definition: GLee.h:876
void addPath ( const QPainterPath path)
void addRegion ( const QRegion region)
void addRoundedRect ( const QRectF rect,
qreal  xRadius,
qreal  yRadius,
Qt::SizeMode  mode = Qt::AbsoluteSize 
)
void addRoundedRect ( qreal  x,
qreal  y,
qreal  w,
qreal  h,
qreal  xRadius,
qreal  yRadius,
Qt::SizeMode  mode = Qt::AbsoluteSize 
)
inline

Definition at line 350 of file qpainterpath.h.

353 {
354  addRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode);
355 }
GLenum GLint GLint y
Definition: GLee.h:876
GLint mode
Definition: GLee.h:4479
GLenum GLint x
Definition: GLee.h:876
Definition: qrect.h:511
int int int int int int h
Definition: GLee.h:10534
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
void addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
void addRoundRect ( const QRectF rect,
int  xRnd,
int  yRnd 
)
void addRoundRect ( qreal  x,
qreal  y,
qreal  w,
qreal  h,
int  xRnd,
int  yRnd 
)
inline

Definition at line 357 of file qpainterpath.h.

359 {
360  addRoundRect(QRectF(x, y, w, h), xRnd, yRnd);
361 }
GLenum GLint GLint y
Definition: GLee.h:876
void addRoundRect(const QRectF &rect, int xRnd, int yRnd)
GLenum GLint x
Definition: GLee.h:876
Definition: qrect.h:511
int int int int int int h
Definition: GLee.h:10534
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
void addRoundRect ( const QRectF rect,
int  roundness 
)
inline

Definition at line 363 of file qpainterpath.h.

365 {
366  int xRnd = roundness;
367  int yRnd = roundness;
368  if (rect.width() > rect.height())
369  xRnd = int(roundness * rect.height()/rect.width());
370  else
371  yRnd = int(roundness * rect.width()/rect.height());
372  addRoundRect(rect, xRnd, yRnd);
373 }
unsigned int(APIENTRYP PFNGLXGETAGPOFFSETMESAPROC)(const void *pointer)
Definition: GLee.h:10762
void addRoundRect(const QRectF &rect, int xRnd, int yRnd)
qreal height() const
Definition: qrect.h:710
qreal width() const
Definition: qrect.h:707
void addRoundRect ( qreal  x,
qreal  y,
qreal  w,
qreal  h,
int  roundness 
)
inline

Definition at line 375 of file qpainterpath.h.

377 {
378  addRoundRect(QRectF(x, y, w, h), roundness);
379 }
GLenum GLint GLint y
Definition: GLee.h:876
void addRoundRect(const QRectF &rect, int xRnd, int yRnd)
GLenum GLint x
Definition: GLee.h:876
Definition: qrect.h:511
int int int int int int h
Definition: GLee.h:10534
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
void connectPath ( const QPainterPath path)
bool contains ( const QPointF pt) const
bool contains ( const QRectF rect) const
bool intersects ( const QRectF rect) const
void translate ( qreal  dx,
qreal  dy 
)
void translate ( const QPointF offset)
inline

Definition at line 386 of file qpainterpath.h.

387 { translate(offset.x(), offset.y()); }
void translate(qreal dx, qreal dy)
qreal y() const
Definition: qpoint.h:287
qreal x() const
Definition: qpoint.h:282
QPainterPath translated ( qreal  dx,
qreal  dy 
) const
QPainterPath translated ( const QPointF offset) const
inline

Definition at line 389 of file qpainterpath.h.

390 { return translated(offset.x(), offset.y()); }
QPainterPath translated(qreal dx, qreal dy) const
qreal y() const
Definition: qpoint.h:287
qreal x() const
Definition: qpoint.h:282
QRectF boundingRect ( ) const
QRectF controlPointRect ( ) const
Qt::FillRule fillRule ( ) const
void setFillRule ( Qt::FillRule  fillRule)
bool isEmpty ( ) const
inline

Definition at line 392 of file qpainterpath.h.

393 {
394  return !d_ptr || (d_ptr->elements.size() == 1 && d_ptr->elements.first().type == MoveToElement);
395 }
T & first()
Definition: qvector.h:260
int size() const
Definition: qvector.h:137
QPainterPath toReversed ( ) const
QList<QPolygonF> toSubpathPolygons ( const QMatrix matrix = QMatrix()) const
QList<QPolygonF> toFillPolygons ( const QMatrix matrix = QMatrix()) const
QPolygonF toFillPolygon ( const QMatrix matrix = QMatrix()) const
QList<QPolygonF> toSubpathPolygons ( const QTransform matrix) const
QList<QPolygonF> toFillPolygons ( const QTransform matrix) const
QPolygonF toFillPolygon ( const QTransform matrix) const
int elementCount ( ) const
inline

Definition at line 397 of file qpainterpath.h.

398 {
399  return d_ptr ? d_ptr->elements.size() : 0;
400 }
int size() const
Definition: qvector.h:137
const QPainterPath::Element & elementAt ( int  i) const
inline

Definition at line 402 of file qpainterpath.h.

403 {
404  Q_ASSERT(d_ptr);
405  Q_ASSERT(i >= 0 && i < elementCount());
406  return d_ptr->elements.at(i);
407 }
const T & at(int i) const
Definition: qvector.h:350
int elementCount() const
Definition: qpainterpath.h:397
void setElementPositionAt ( int  i,
qreal  x,
qreal  y 
)
inline

Definition at line 409 of file qpainterpath.h.

410 {
411  Q_ASSERT(d_ptr);
412  Q_ASSERT(i >= 0 && i < elementCount());
413  detach();
414  QPainterPath::Element &e = d_ptr->elements[i];
415  e.x = x;
416  e.y = y;
417 }
GLenum GLint GLint y
Definition: GLee.h:876
GLenum GLint x
Definition: GLee.h:876
int elementCount() const
Definition: qpainterpath.h:397
qreal length ( ) const
qreal percentAtLength ( qreal  t) const
QPointF pointAtPercent ( qreal  t) const
qreal angleAtPercent ( qreal  t) const
qreal slopeAtPercent ( qreal  t) const
bool intersects ( const QPainterPath p) const
bool contains ( const QPainterPath p) const
QPainterPath united ( const QPainterPath r) const
QPainterPath intersected ( const QPainterPath r) const
QPainterPath subtracted ( const QPainterPath r) const
QPainterPath subtractedInverted ( const QPainterPath r) const
QPainterPath simplified ( ) const
bool operator== ( const QPainterPath other) const
bool operator!= ( const QPainterPath other) const
QPainterPath operator& ( const QPainterPath other) const
QPainterPath operator| ( const QPainterPath other) const
QPainterPath operator+ ( const QPainterPath other) const
QPainterPath operator- ( const QPainterPath other) const
QPainterPath& operator&= ( const QPainterPath other)
QPainterPath& operator|= ( const QPainterPath other)
QPainterPath& operator+= ( const QPainterPath other)
QPainterPath& operator-= ( const QPainterPath other)

Friends And Related Function Documentation

friend class QPainterPathData
friend

Definition at line 223 of file qpainterpath.h.

friend class QPainterPathStroker
friend

Definition at line 224 of file qpainterpath.h.

friend class QPainterPathStrokerPrivate
friend

Definition at line 225 of file qpainterpath.h.

friend class QMatrix
friend

Definition at line 226 of file qpainterpath.h.

friend class QTransform
friend

Definition at line 227 of file qpainterpath.h.

friend class QVectorPath
friend

Definition at line 228 of file qpainterpath.h.

Q_GUI_EXPORT const QVectorPath& qtVectorPathForPath ( const QPainterPath )
friend
Q_GUI_EXPORT QDataStream& operator<< ( QDataStream ,
const QPainterPath  
)
friend
Q_GUI_EXPORT QDataStream& operator>> ( QDataStream ,
QPainterPath  
)
friend

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