Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QSvgNode Class Referenceabstract

#include <qsvgnode_p.h>

+ Inheritance diagram for QSvgNode:
+ Collaboration diagram for QSvgNode:

Public Types

enum  Type {
  DOC , G , DEFS , SWITCH ,
  ANIMATION , ARC , CIRCLE , ELLIPSE ,
  IMAGE , LINE , PATH , POLYGON ,
  POLYLINE , RECT , TEXT , TEXTAREA ,
  TSPAN , USE , VIDEO
}
 
enum  DisplayMode {
  InlineMode , BlockMode , ListItemMode , RunInMode ,
  CompactMode , MarkerMode , TableMode , InlineTableMode ,
  TableRowGroupMode , TableHeaderGroupMode , TableFooterGroupMode , TableRowMode ,
  TableColumnGroupMode , TableColumnMode , TableCellMode , TableCaptionMode ,
  NoneMode , InheritMode
}
 

Public Member Functions

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

Static Protected Member Functions

static qreal strokeWidth (QPainter *p)
 

Protected Attributes

QSvgStyle m_style
 

Friends

class QSvgTinyDocument
 

Detailed Description

Definition at line 29 of file qsvgnode_p.h.

Member Enumeration Documentation

◆ DisplayMode

Enumerator
InlineMode 
BlockMode 
ListItemMode 
RunInMode 
CompactMode 
MarkerMode 
TableMode 
InlineTableMode 
TableRowGroupMode 
TableHeaderGroupMode 
TableFooterGroupMode 
TableRowMode 
TableColumnGroupMode 
TableColumnMode 
TableCellMode 
TableCaptionMode 
NoneMode 
InheritMode 

Definition at line 54 of file qsvgnode_p.h.

◆ Type

Enumerator
DOC 
DEFS 
SWITCH 
ANIMATION 
ARC 
CIRCLE 
ELLIPSE 
IMAGE 
LINE 
PATH 
POLYGON 
POLYLINE 
RECT 
TEXT 
TEXTAREA 
TSPAN 
USE 
VIDEO 

Definition at line 32 of file qsvgnode_p.h.

Constructor & Destructor Documentation

◆ QSvgNode()

QT_BEGIN_NAMESPACE QSvgNode::QSvgNode ( QSvgNode parent = 0)

Definition at line 22 of file qsvgnode.cpp.

◆ ~QSvgNode()

QSvgNode::~QSvgNode ( )
virtual

Definition at line 29 of file qsvgnode.cpp.

Member Function Documentation

◆ appendStyleProperty()

◆ applyStyle()

void QSvgNode::applyStyle ( QPainter p,
QSvgExtraStates states 
) const

Definition at line 99 of file qsvgnode.cpp.

References QSvgStyle::apply(), and m_style.

Referenced by QSvgTinyDocument::draw(), QSvgTinyDocument::draw(), QSvgArc::draw(), QSvgEllipse::draw(), QSvgImage::draw(), QSvgLine::draw(), QSvgPath::draw(), QSvgPolygon::draw(), QSvgPolyline::draw(), QSvgRect::draw(), QSvgUse::draw(), QSvgVideo::draw(), QSvgG::draw(), QSvgSwitch::draw(), transformedBounds(), and transformedBounds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bounds()

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

Reimplemented in QSvgArc, QSvgEllipse, QSvgImage, QSvgLine, QSvgPath, QSvgPolygon, QSvgPolyline, QSvgRect, QSvgText, QSvgUse, and QSvgStructureNode.

Definition at line 185 of file qsvgnode.cpp.

Referenced by fastBounds(), and transformedBounds().

+ Here is the caller graph for this function:

◆ displayMode()

QSvgNode::DisplayMode QSvgNode::displayMode ( ) const

Definition at line 316 of file qsvgnode.cpp.

Referenced by QSvgTinyDocument::draw(), QSvgTinyDocument::draw(), QSvgG::draw(), and QSvgSwitch::draw().

+ Here is the caller graph for this function:

◆ document()

QSvgTinyDocument * QSvgNode::document ( ) const

Definition at line 219 of file qsvgnode.cpp.

References DOC, parent(), and type().

Referenced by QSvgStructureNode::addChild(), appendStyleProperty(), QSvgStyle::apply(), QSvgAnimateColor::apply(), parseFont(), QSvgAnimateTransform::resolveMatrix(), QSvgStructureNode::scopeNode(), and styleProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw()

virtual void QSvgNode::draw ( QPainter p,
QSvgExtraStates states 
)
pure virtual

Implemented in QSvgTspan, QSvgTinyDocument, QSvgAnimation, QSvgArc, QSvgEllipse, QSvgImage, QSvgLine, QSvgPath, QSvgPolygon, QSvgPolyline, QSvgRect, QSvgText, QSvgUse, QSvgVideo, QSvgG, QSvgDefs, and QSvgSwitch.

Referenced by QSvgTinyDocument::draw(), QSvgTinyDocument::draw(), QSvgUse::draw(), QSvgG::draw(), and QSvgSwitch::draw().

+ Here is the caller graph for this function:

◆ fastBounds()

QRectF QSvgNode::fastBounds ( QPainter p,
QSvgExtraStates states 
) const
virtual

Reimplemented in QSvgArc, QSvgEllipse, QSvgLine, QSvgPath, QSvgPolygon, QSvgPolyline, QSvgRect, and QSvgText.

Definition at line 180 of file qsvgnode.cpp.

References bounds().

Referenced by shouldDrawNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDescendantOf()

bool QSvgNode::isDescendantOf ( const QSvgNode parent) const

Definition at line 34 of file qsvgnode.cpp.

References parent().

Referenced by QSvgUse::bounds(), and QSvgUse::draw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isVisible()

bool QSvgNode::isVisible ( ) const
inline

Definition at line 153 of file qsvgnode_p.h.

Referenced by QSvgTinyDocument::draw(), QSvgG::draw(), QSvgSwitch::draw(), and setVisible().

+ Here is the caller graph for this function:

◆ nodeId()

QString QSvgNode::nodeId ( ) const
inline

Definition at line 158 of file qsvgnode_p.h.

◆ parent()

QSvgNode * QSvgNode::parent ( ) const
inline

Definition at line 148 of file qsvgnode_p.h.

Referenced by createLinearGradientNode(), document(), QSvgTinyDocument::draw(), isDescendantOf(), QSvgStyleSelector::parentNode(), parseVisibility(), styleProperty(), transformedBounds(), and QSvgTinyDocument::transformForElement().

+ Here is the caller graph for this function:

◆ requiredExtensions()

const QStringList & QSvgNode::requiredExtensions ( ) const

Definition at line 246 of file qsvgnode.cpp.

Referenced by QSvgSwitch::draw().

+ Here is the caller graph for this function:

◆ requiredFeatures()

const QStringList & QSvgNode::requiredFeatures ( ) const

Definition at line 236 of file qsvgnode.cpp.

Referenced by QSvgSwitch::draw().

+ Here is the caller graph for this function:

◆ requiredFonts()

const QStringList & QSvgNode::requiredFonts ( ) const

Definition at line 276 of file qsvgnode.cpp.

Referenced by QSvgSwitch::draw().

+ Here is the caller graph for this function:

◆ requiredFormats()

const QStringList & QSvgNode::requiredFormats ( ) const

Definition at line 266 of file qsvgnode.cpp.

Referenced by QSvgSwitch::draw().

+ Here is the caller graph for this function:

◆ requiredLanguages()

const QStringList & QSvgNode::requiredLanguages ( ) const

Definition at line 256 of file qsvgnode.cpp.

Referenced by QSvgSwitch::draw().

+ Here is the caller graph for this function:

◆ revertStyle()

void QSvgNode::revertStyle ( QPainter p,
QSvgExtraStates states 
) const

Definition at line 104 of file qsvgnode.cpp.

References m_style, and QSvgStyle::revert().

Referenced by QSvgTinyDocument::draw(), QSvgTinyDocument::draw(), QSvgArc::draw(), QSvgEllipse::draw(), QSvgImage::draw(), QSvgLine::draw(), QSvgPath::draw(), QSvgPolygon::draw(), QSvgPolyline::draw(), QSvgRect::draw(), QSvgUse::draw(), QSvgVideo::draw(), QSvgG::draw(), QSvgSwitch::draw(), and transformedBounds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDisplayMode()

void QSvgNode::setDisplayMode ( DisplayMode  display)

Definition at line 311 of file qsvgnode.cpp.

Referenced by parseOthers().

+ Here is the caller graph for this function:

◆ setNodeId()

void QSvgNode::setNodeId ( const QString i)

Definition at line 301 of file qsvgnode.cpp.

References i.

Referenced by parseCoreNode(), and parseStopNode().

+ Here is the caller graph for this function:

◆ setRequiredExtensions()

void QSvgNode::setRequiredExtensions ( const QStringList lst)

Definition at line 241 of file qsvgnode.cpp.

Referenced by parseCoreNode().

+ Here is the caller graph for this function:

◆ setRequiredFeatures()

void QSvgNode::setRequiredFeatures ( const QStringList lst)

Definition at line 231 of file qsvgnode.cpp.

Referenced by parseCoreNode().

+ Here is the caller graph for this function:

◆ setRequiredFonts()

void QSvgNode::setRequiredFonts ( const QStringList lst)

Definition at line 271 of file qsvgnode.cpp.

Referenced by parseCoreNode().

+ Here is the caller graph for this function:

◆ setRequiredFormats()

void QSvgNode::setRequiredFormats ( const QStringList lst)

Definition at line 261 of file qsvgnode.cpp.

Referenced by parseCoreNode().

+ Here is the caller graph for this function:

◆ setRequiredLanguages()

void QSvgNode::setRequiredLanguages ( const QStringList lst)

Definition at line 251 of file qsvgnode.cpp.

Referenced by parseCoreNode().

+ Here is the caller graph for this function:

◆ setVisible()

void QSvgNode::setVisible ( bool  visible)

Definition at line 281 of file qsvgnode.cpp.

References isVisible(), and setVisible().

Referenced by parseVisibility(), and setVisible().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setXmlClass()

void QSvgNode::setXmlClass ( const QString str)

Definition at line 306 of file qsvgnode.cpp.

References str.

Referenced by parseCoreNode(), and parseStopNode().

+ Here is the caller graph for this function:

◆ shouldDrawNode()

bool QSvgNode::shouldDrawNode ( QPainter p,
QSvgExtraStates states 
) const

Definition at line 329 of file qsvgnode.cpp.

References fastBounds(), QRectF::height(), qCWarning, qEnvironmentVariableIntValue(), QT_SVG_SIZE_LIMIT, type(), and QRectF::width().

Referenced by QSvgArc::draw(), QSvgEllipse::draw(), QSvgImage::draw(), QSvgLine::draw(), QSvgPath::draw(), QSvgPolygon::draw(), QSvgPolyline::draw(), and QSvgRect::draw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strokeWidth()

qreal QSvgNode::strokeWidth ( QPainter p)
staticprotected

Definition at line 321 of file qsvgnode.cpp.

References QPen::brush(), QPen::isCosmetic(), Qt::NoBrush, Qt::NoPen, QBrush::style(), QPen::style(), and QPen::widthF().

Referenced by QSvgArc::bounds(), QSvgEllipse::bounds(), QSvgLine::bounds(), QSvgPath::bounds(), QSvgPolygon::bounds(), QSvgPolyline::bounds(), and QSvgRect::bounds().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ styleProperty() [1/2]

QSvgFillStyleProperty * QSvgNode::styleProperty ( const QString id) const

Definition at line 171 of file qsvgnode.cpp.

References document(), QSvgTinyDocument::namedStyle(), QString::remove(), and QString::startsWith().

+ Here is the call graph for this function:

◆ styleProperty() [2/2]

◆ transformedBounds() [1/2]

QRectF QSvgNode::transformedBounds ( ) const

Definition at line 190 of file qsvgnode.cpp.

References applyStyle(), Qt::FlatCap, QImage::Format_RGB32, i, QRectF::isEmpty(), Qt::NoBrush, parent(), QStack< T >::push(), QPen::setMiterLimit(), QList< T >::size(), Qt::SolidLine, Qt::SvgMiterJoin, and transformedBounds().

Referenced by transformedBounds(), and QSvgTinyDocument::viewBox().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transformedBounds() [2/2]

QRectF QSvgNode::transformedBounds ( QPainter p,
QSvgExtraStates states 
) const
virtual

Definition at line 293 of file qsvgnode.cpp.

References applyStyle(), bounds(), rect, and revertStyle().

Referenced by QSvgUse::bounds(), QSvgTinyDocument::boundsOnElement(), and QSvgTinyDocument::draw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ type()

virtual Type QSvgNode::type ( ) const
pure virtual

Implemented in QSvgAnimation, QSvgArc, QSvgEllipse, QSvgCircle, QSvgImage, QSvgLine, QSvgPath, QSvgPolygon, QSvgPolyline, QSvgRect, QSvgText, QSvgTspan, QSvgUse, QSvgVideo, QSvgG, QSvgDefs, QSvgSwitch, and QSvgTinyDocument.

Referenced by QSvgHandler::characters(), createLinearGradientNode(), document(), QSvgStyleSelector::nodeToName(), shouldDrawNode(), and QSvgHandler::startElement().

+ Here is the caller graph for this function:

◆ xmlClass()

QString QSvgNode::xmlClass ( ) const
inline

Definition at line 163 of file qsvgnode_p.h.

Friends And Related Symbol Documentation

◆ QSvgTinyDocument

friend class QSvgTinyDocument
friend

Definition at line 145 of file qsvgnode_p.h.

Member Data Documentation

◆ m_style

QSvgStyle QSvgNode::m_style
mutableprotected

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