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

#include <qsvggraphics_p.h>

Inheritance diagram for QSvgPolygon:
QSvgNode

Public Functions

virtual QRectF bounds (QPainter *p, QSvgExtraStates &states) const
 
virtual void draw (QPainter *p, QSvgExtraStates &states)
 
 QSvgPolygon (QSvgNode *parent, const QPolygonF &poly)
 
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

QPolygonF m_poly
 

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 145 of file qsvggraphics_p.h.

Constructors and Destructors

◆ QSvgPolygon()

QSvgPolygon::QSvgPolygon ( QSvgNode parent,
const QPolygonF poly 
)

Definition at line 184 of file qsvggraphics.cpp.

185  : QSvgNode(parent), m_poly(poly)
186 {
187 }
QPolygonF m_poly
QSvgNode(QSvgNode *parent=0)
Definition: qsvgnode.cpp:52

Functions

◆ bounds()

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

Reimplemented from QSvgNode.

Definition at line 189 of file qsvggraphics.cpp.

190 {
191  qreal sw = strokeWidth(p);
192  if (qFuzzyIsNull(sw)) {
193  return p->transform().map(m_poly).boundingRect();
194  } else {
195  QPainterPath path;
196  path.addPolygon(m_poly);
197  return boundsOnStroke(p, path, sw);
198  }
199 }
QPolygonF m_poly
double qreal
Definition: qglobal.h:1193
const QTransform & transform() const
Returns the world transformation matrix.
Definition: qpainter.cpp:9558
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
void addPolygon(const QPolygonF &polygon)
Adds the given polygon to the path as an (unclosed) subpath.
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 QSvgPolygon::draw ( QPainter p,
QSvgExtraStates states 
)
virtual

Implements QSvgNode.

Definition at line 201 of file qsvggraphics.cpp.

202 {
203  applyStyle(p, states);
205  revertStyle(p, states);
206 }
QPolygonF m_poly
void applyStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:118
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
Draws the polygon defined by the first pointCount points in the array points using the current pen an...
Definition: qpainter.cpp:5205
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

◆ type()

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

Implements QSvgNode.

Definition at line 529 of file qsvggraphics.cpp.

530 {
531  return POLYGON;
532 }

Properties

◆ m_poly

QPolygonF QSvgPolygon::m_poly
private

Definition at line 153 of file qsvggraphics_p.h.

Referenced by bounds(), and draw().


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