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

#include <qsvggraphics_p.h>

Inheritance diagram for QSvgArc:
QSvgNode

Public Functions

virtual QRectF bounds (QPainter *p, QSvgExtraStates &states) const
 
virtual void draw (QPainter *p, QSvgExtraStates &states)
 
 QSvgArc (QSvgNode *parent, const QPainterPath &path)
 
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 77 of file qsvggraphics_p.h.

Constructors and Destructors

◆ QSvgArc()

QSvgArc::QSvgArc ( QSvgNode parent,
const QPainterPath path 
)

Definition at line 110 of file qsvggraphics.cpp.

111  : QSvgNode(parent), m_path(path)
112 {
113 }
QSvgNode(QSvgNode *parent=0)
Definition: qsvgnode.cpp:52
QPainterPath m_path

Functions

◆ bounds()

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

Reimplemented from QSvgNode.

Definition at line 582 of file qsvggraphics.cpp.

583 {
584  qreal sw = strokeWidth(p);
585  return qFuzzyIsNull(sw) ? p->transform().map(m_path).boundingRect()
586  : boundsOnStroke(p, m_path, sw);
587 }
double qreal
Definition: qglobal.h:1193
const QTransform & transform() const
Returns the world transformation matrix.
Definition: qpainter.cpp:9558
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
QPainterPath m_path

◆ draw()

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

Implements QSvgNode.

Definition at line 115 of file qsvggraphics.cpp.

116 {
117  applyStyle(p, states);
118  if (p->pen().widthF() != 0) {
119  qreal oldOpacity = p->opacity();
120  p->setOpacity(oldOpacity * states.strokeOpacity);
121  p->drawPath(m_path);
122  p->setOpacity(oldOpacity);
123  }
124  revertStyle(p, states);
125 }
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
double qreal
Definition: qglobal.h:1193
qreal opacity() const
Returns the opacity of the painter.
Definition: qpainter.cpp:2115
void applyStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:118
const QPen & pen() const
Returns the painter&#39;s current pen.
Definition: qpainter.cpp:4152
qreal widthF() const
Returns the pen width with floating point precision.
Definition: qpen.cpp:645
void setOpacity(qreal opacity)
Sets the opacity of the painter to opacity.
Definition: qpainter.cpp:2139
void revertStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:123
QPainterPath m_path

◆ type()

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

Implements QSvgNode.

Definition at line 499 of file qsvggraphics.cpp.

500 {
501  return ARC;
502 }

Properties

◆ m_path

QPainterPath QSvgArc::m_path
private

Definition at line 85 of file qsvggraphics_p.h.

Referenced by draw().


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