Qt 4.8
Public Functions | Properties | List of all members
QSvgPath Class Reference

#include <qsvggraphics_p.h>

Inheritance diagram for QSvgPath:
QSvgNode

Public Functions

virtual QRectF bounds (QPainter *p, QSvgExtraStates &states) const
 
virtual void draw (QPainter *p, QSvgExtraStates &states)
 
QPainterPathqpath ()
 
 QSvgPath (QSvgNode *parent, const QPainterPath &qpath)
 
virtual Type type () const
 
- Public Functions inherited from QSvgNode
void appendStyleProperty (QSvgStyleProperty *prop, const QString &id)
 
void applyStyle (QPainter *p, QSvgExtraStates &states) const
 
DisplayMode displayMode () const
 
QSvgTinyDocumentdocument () const
 
bool isVisible () const
 
QString nodeId () const
 
QSvgNodeparent () const
 
 QSvgNode (QSvgNode *parent=0)
 
const QStringListrequiredExtensions () const
 
const QStringListrequiredFeatures () const
 
const QStringListrequiredFonts () const
 
const QStringListrequiredFormats () const
 
const QStringListrequiredLanguages () const
 
void revertStyle (QPainter *p, QSvgExtraStates &states) const
 
void setDisplayMode (DisplayMode display)
 
void setNodeId (const QString &i)
 
void setRequiredExtensions (const QStringList &lst)
 
void setRequiredFeatures (const QStringList &lst)
 
void setRequiredFonts (const QStringList &lst)
 
void setRequiredFormats (const QStringList &lst)
 
void setRequiredLanguages (const QStringList &lst)
 
void setVisible (bool visible)
 
void setXmlClass (const QString &str)
 
QSvgStylePropertystyleProperty (QSvgStyleProperty::Type type) const
 
QSvgFillStylePropertystyleProperty (const QString &id) const
 
virtual QRectF transformedBounds (QPainter *p, QSvgExtraStates &states) const
 
QRectF transformedBounds () const
 
QString xmlClass () const
 
virtual ~QSvgNode ()
 

Properties

QPainterPath m_path
 

Additional Inherited Members

- Public Types inherited from QSvgNode
enum  DisplayMode {
  InlineMode, BlockMode, ListItemMode, RunInMode,
  CompactMode, MarkerMode, TableMode, InlineTableMode,
  TableRowGroupMode, TableHeaderGroupMode, TableFooterGroupMode, TableRowMode,
  TableColumnGroupMode, TableColumnMode, TableCellMode, TableCaptionMode,
  NoneMode, InheritMode
}
 
enum  Type {
  DOC, G, DEFS, SWITCH,
  ANIMATION, ARC, CIRCLE, ELLIPSE,
  IMAGE, LINE, PATH, POLYGON,
  POLYLINE, RECT, TEXT, TEXTAREA,
  TSPAN, USE, VIDEO
}
 
- Static Protected Functions inherited from QSvgNode
static qreal strokeWidth (QPainter *p)
 
- Protected Variables inherited from QSvgNode
QSvgStyle m_style
 

Detailed Description

Definition at line 130 of file qsvggraphics_p.h.

Constructors and Destructors

◆ QSvgPath()

QSvgPath::QSvgPath ( QSvgNode parent,
const QPainterPath qpath 
)

Definition at line 164 of file qsvggraphics.cpp.

165  : QSvgNode(parent), m_path(qpath)
166 {
167 }
QPainterPath m_path
QSvgNode(QSvgNode *parent=0)
Definition: qsvgnode.cpp:52

Functions

◆ bounds()

QRectF QSvgPath::bounds ( QPainter p,
QSvgExtraStates states 
) const
virtual

Reimplemented from QSvgNode.

Definition at line 177 of file qsvggraphics.cpp.

178 {
179  qreal sw = strokeWidth(p);
180  return qFuzzyIsNull(sw) ? p->transform().map(m_path).boundingRect()
181  : boundsOnStroke(p, m_path, sw);
182 }
double qreal
Definition: qglobal.h:1193
const QTransform & transform() const
Returns the world transformation matrix.
Definition: qpainter.cpp:9558
QPainterPath m_path
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...
static qreal strokeWidth(QPainter *p)
Definition: qsvgnode.cpp:335
static QRectF boundsOnStroke(QPainter *p, const QPainterPath &path, qreal width)
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
Definition: qglobal.h:2043

◆ draw()

void QSvgPath::draw ( QPainter p,
QSvgExtraStates states 
)
virtual

Implements QSvgNode.

Definition at line 169 of file qsvggraphics.cpp.

170 {
171  applyStyle(p, states);
172  m_path.setFillRule(states.fillRule);
174  revertStyle(p, states);
175 }
void drawPath(const QPainterPath &path)
Draws the given painter path using the current pen for outline and the current brush for filling...
Definition: qpainter.cpp:3502
QPainterPath m_path
void applyStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:118
void setFillRule(Qt::FillRule fillRule)
Sets the fill rule of the painter path to the given fillRule.
Qt::FillRule fillRule
Definition: qsvgstyle_p.h:150
#define QT_SVG_DRAW_SHAPE(command)
void revertStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:123

◆ qpath()

QPainterPath* QSvgPath::qpath ( )
inline

Definition at line 138 of file qsvggraphics_p.h.

138  {
139  return &m_path;
140  }
QPainterPath m_path

◆ type()

QSvgNode::Type QSvgPath::type ( ) const
virtual

Implements QSvgNode.

Definition at line 524 of file qsvggraphics.cpp.

525 {
526  return PATH;
527 }

Properties

◆ m_path

QPainterPath QSvgPath::m_path
private

Definition at line 142 of file qsvggraphics_p.h.

Referenced by bounds(), and draw().


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