Qt 4.8
Public Functions | Protected Variables | List of all members
QSvgStructureNode Class Reference

#include <qsvgstructure_p.h>

Inheritance diagram for QSvgStructureNode:
QSvgNode QSvgDefs QSvgG QSvgSwitch QSvgTinyDocument

Public Functions

void addChild (QSvgNode *child, const QString &id)
 
virtual QRectF bounds (QPainter *p, QSvgExtraStates &states) const
 
QSvgNodepreviousSiblingNode (QSvgNode *n) const
 
 QSvgStructureNode (QSvgNode *parent)
 
QList< QSvgNode * > renderers () const
 
QSvgNodescopeNode (const QString &id) const
 
 ~QSvgStructureNode ()
 
- Public Functions inherited from QSvgNode
void appendStyleProperty (QSvgStyleProperty *prop, const QString &id)
 
void applyStyle (QPainter *p, QSvgExtraStates &states) const
 
DisplayMode displayMode () const
 
QSvgTinyDocumentdocument () const
 
virtual void draw (QPainter *p, QSvgExtraStates &states)=0
 
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
 
virtual Type type () const =0
 
QString xmlClass () const
 
virtual ~QSvgNode ()
 

Protected Variables

QList< QSvgStructureNode * > m_linkedScopes
 
QList< QSvgNode * > m_renderers
 
QHash< QString, QSvgNode * > m_scope
 
- Protected Variables inherited from QSvgNode
QSvgStyle m_style
 

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)
 

Detailed Description

Definition at line 70 of file qsvgstructure_p.h.

Constructors and Destructors

◆ QSvgStructureNode()

QSvgStructureNode::QSvgStructureNode ( QSvgNode parent)

Definition at line 86 of file qsvgstructure.cpp.

87  :QSvgNode(parent)
88 {
89 
90 }
QSvgNode(QSvgNode *parent=0)
Definition: qsvgnode.cpp:52

◆ ~QSvgStructureNode()

QSvgStructureNode::~QSvgStructureNode ( )

Definition at line 62 of file qsvgstructure.cpp.

63 {
65 }
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319
QList< QSvgNode * > m_renderers

Functions

◆ addChild()

void QSvgStructureNode::addChild ( QSvgNode child,
const QString id 
)

Definition at line 98 of file qsvgstructure.cpp.

Referenced by QSvgHandler::startElement().

99 {
100  m_renderers.append(child);
101 
102  if (id.isEmpty())
103  return; //we can't add it to scope without id
104 
105  QSvgTinyDocument *doc = document();
106  if (doc)
107  doc->addNamedNode(id, child);
108 }
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
static bool isEmpty(const char *str)
void addNamedNode(const QString &id, QSvgNode *node)
QSvgTinyDocument * document() const
Definition: qsvgnode.cpp:233
QList< QSvgNode * > m_renderers

◆ bounds()

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

Reimplemented from QSvgNode.

Definition at line 360 of file qsvgstructure.cpp.

361 {
362  QRectF bounds;
363  foreach(QSvgNode *node, m_renderers)
364  bounds |= node->transformedBounds(p, states);
365  return bounds;
366 }
virtual QRectF transformedBounds(QPainter *p, QSvgExtraStates &states) const
Definition: qsvgnode.cpp:307
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
virtual QRectF bounds(QPainter *p, QSvgExtraStates &states) const
QList< QSvgNode * > m_renderers

◆ previousSiblingNode()

QSvgNode * QSvgStructureNode::previousSiblingNode ( QSvgNode n) const

Definition at line 368 of file qsvgstructure.cpp.

Referenced by QSvgStyleSelector::previousSiblingNode().

369 {
370  QSvgNode *prev = 0;
372  for (; itr != m_renderers.constEnd(); ++itr) {
373  QSvgNode *node = *itr;
374  if (node == n)
375  return prev;
376  prev = node;
377  }
378  return prev;
379 }
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
QList< QSvgNode * > m_renderers
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ renderers()

QList<QSvgNode*> QSvgStructureNode::renderers ( ) const
inline

Definition at line 79 of file qsvgstructure_p.h.

Referenced by QSvgHandler::resolveGradients().

79 { return m_renderers; }
QList< QSvgNode * > m_renderers

◆ scopeNode()

QSvgNode * QSvgStructureNode::scopeNode ( const QString id) const

Definition at line 92 of file qsvgstructure.cpp.

Referenced by QSvgTinyDocument::boundsOnElement(), createUseNode(), QSvgTinyDocument::draw(), QSvgTinyDocument::elementExists(), and QSvgTinyDocument::matrixForElement().

93 {
94  QSvgTinyDocument *doc = document();
95  return doc ? doc->namedNode(id) : 0;
96 }
QSvgTinyDocument * document() const
Definition: qsvgnode.cpp:233
QSvgNode * namedNode(const QString &id) const

Properties

◆ m_linkedScopes

QList<QSvgStructureNode*> QSvgStructureNode::m_linkedScopes
protected

Definition at line 83 of file qsvgstructure_p.h.

◆ m_renderers

QList<QSvgNode*> QSvgStructureNode::m_renderers
protected

◆ m_scope

QHash<QString, QSvgNode*> QSvgStructureNode::m_scope
protected

Definition at line 82 of file qsvgstructure_p.h.


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