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

#include <qsvggraphics_p.h>

Inheritance diagram for QSvgUse:
QSvgNode

Public Functions

virtual QRectF bounds (QPainter *p, QSvgExtraStates &states) const
 
virtual void draw (QPainter *p, QSvgExtraStates &states)
 
 QSvgUse (const QPointF &start, QSvgNode *parent, QSvgNode *link)
 
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

QSvgNodem_link
 
QPointF m_start
 

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

Constructors and Destructors

◆ QSvgUse()

QSvgUse::QSvgUse ( const QPointF start,
QSvgNode parent,
QSvgNode link 
)

Definition at line 466 of file qsvggraphics.cpp.

467  : QSvgNode(parent), m_link(node), m_start(start)
468 {
469 
470 }
QSvgNode * m_link
QSvgNode(QSvgNode *parent=0)
Definition: qsvgnode.cpp:52
QPointF m_start

Functions

◆ bounds()

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

Reimplemented from QSvgNode.

Definition at line 559 of file qsvggraphics.cpp.

560 {
561  QRectF bounds;
562  if (m_link) {
563  p->translate(m_start);
564  bounds = m_link->transformedBounds(p, states);
565  p->translate(-m_start);
566  }
567  return bounds;
568 }
virtual QRectF transformedBounds(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:307
QSvgNode * m_link
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QPointF m_start
virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
Definition: qpainter.cpp:3311

◆ draw()

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

Implements QSvgNode.

Definition at line 472 of file qsvggraphics.cpp.

473 {
474  applyStyle(p, states);
475 
476  if (!m_start.isNull()) {
477  p->translate(m_start);
478  }
479  m_link->draw(p, states);
480  if (!m_start.isNull()) {
481  p->translate(-m_start);
482  }
483 
484  revertStyle(p, states);
485 }
QSvgNode * m_link
void applyStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:118
QPointF m_start
bool isNull() const
Returns true if both the x and y coordinates are set to +0.
Definition: qpoint.h:277
virtual void draw(QPainter *p, QSvgExtraStates &states)=0
void revertStyle(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:123
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
Definition: qpainter.cpp:3311

◆ type()

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

Implements QSvgNode.

Definition at line 549 of file qsvggraphics.cpp.

550 {
551  return USE;
552 }

Properties

◆ m_link

QSvgNode* QSvgUse::m_link
private

Definition at line 248 of file qsvggraphics_p.h.

Referenced by bounds(), and draw().

◆ m_start

QPointF QSvgUse::m_start
private

Definition at line 249 of file qsvggraphics_p.h.

Referenced by bounds(), and draw().


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