Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QSvgTinyDocument Class Reference

#include <qsvgtinydocument_p.h>

+ Inheritance diagram for QSvgTinyDocument:
+ Collaboration diagram for QSvgTinyDocument:

Public Member Functions

 QSvgTinyDocument ()
 
 ~QSvgTinyDocument ()
 
Type type () const override
 
QSize size () const
 
void setWidth (int len, bool percent)
 
void setHeight (int len, bool percent)
 
int width () const
 
int height () const
 
bool widthPercent () const
 
bool heightPercent () const
 
bool preserveAspectRatio () const
 
void setPreserveAspectRatio (bool on)
 
QRectF viewBox () const
 
void setViewBox (const QRectF &rect)
 
void draw (QPainter *p, QSvgExtraStates &) override
 
void draw (QPainter *p)
 
void draw (QPainter *p, const QRectF &bounds)
 
void draw (QPainter *p, const QString &id, const QRectF &bounds=QRectF())
 
QTransform transformForElement (const QString &id) const
 
QRectF boundsOnElement (const QString &id) const
 
bool elementExists (const QString &id) const
 
void addSvgFont (QSvgFont *)
 
QSvgFontsvgFont (const QString &family) const
 
void addNamedNode (const QString &id, QSvgNode *node)
 
QSvgNodenamedNode (const QString &id) const
 
void addNamedStyle (const QString &id, QSvgFillStyleProperty *style)
 
QSvgFillStylePropertynamedStyle (const QString &id) const
 
void restartAnimation ()
 
int currentElapsed () const
 
bool animated () const
 
void setAnimated (bool a)
 
int animationDuration () const
 
int currentFrame () const
 
void setCurrentFrame (int)
 
void setFramesPerSecond (int num)
 
- Public Member Functions inherited from QSvgStructureNode
 QSvgStructureNode (QSvgNode *parent)
 
 ~QSvgStructureNode ()
 
QSvgNodescopeNode (const QString &id) const
 
void addChild (QSvgNode *child, const QString &id)
 
QRectF bounds (QPainter *p, QSvgExtraStates &states) const override
 
QSvgNodepreviousSiblingNode (QSvgNode *n) const
 
QList< QSvgNode * > renderers () const
 
- Public Member Functions inherited from QSvgNode
 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 Public Member Functions

static QSvgTinyDocumentload (const QString &file)
 
static QSvgTinyDocumentload (const QByteArray &contents)
 
static QSvgTinyDocumentload (QXmlStreamReader *contents)
 

Additional Inherited Members

- Public Types inherited from QSvgNode
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
}
 
- Static Protected Member Functions inherited from QSvgNode
static qreal strokeWidth (QPainter *p)
 
- Protected Attributes inherited from QSvgStructureNode
QList< QSvgNode * > m_renderers
 
QHash< QString, QSvgNode * > m_scope
 
QList< QSvgStructureNode * > m_linkedScopes
 
bool m_recursing = false
 
- Protected Attributes inherited from QSvgNode
QSvgStyle m_style
 

Detailed Description

Definition at line 36 of file qsvgtinydocument_p.h.

Constructor & Destructor Documentation

◆ QSvgTinyDocument()

QT_BEGIN_NAMESPACE QSvgTinyDocument::QSvgTinyDocument ( )

Definition at line 24 of file qsvgtinydocument.cpp.

◆ ~QSvgTinyDocument()

QSvgTinyDocument::~QSvgTinyDocument ( )

Definition at line 35 of file qsvgtinydocument.cpp.

Member Function Documentation

◆ addNamedNode()

void QSvgTinyDocument::addNamedNode ( const QString id,
QSvgNode node 
)

Definition at line 352 of file qsvgtinydocument.cpp.

References QHash< Key, T >::insert().

Referenced by QSvgStructureNode::addChild().

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

◆ addNamedStyle()

void QSvgTinyDocument::addNamedStyle ( const QString id,
QSvgFillStyleProperty style 
)

Definition at line 362 of file qsvgtinydocument.cpp.

References QHash< Key, T >::contains(), QHash< Key, T >::insert(), and qCWarning.

Referenced by QSvgNode::appendStyleProperty().

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

◆ addSvgFont()

void QSvgTinyDocument::addSvgFont ( QSvgFont font)

Definition at line 342 of file qsvgtinydocument.cpp.

References font, and QHash< Key, T >::insert().

Referenced by createFontNode(), parseFontFaceNameNode(), and parseFontFaceNode().

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

◆ animated()

bool QSvgTinyDocument::animated ( ) const

Definition at line 380 of file qsvgtinydocument.cpp.

◆ animationDuration()

int QSvgTinyDocument::animationDuration ( ) const
inline

Definition at line 162 of file qsvgtinydocument_p.h.

◆ boundsOnElement()

QRectF QSvgTinyDocument::boundsOnElement ( const QString id) const

Definition at line 463 of file qsvgtinydocument.cpp.

References QSvgStructureNode::scopeNode(), and QSvgNode::transformedBounds().

+ Here is the call graph for this function:

◆ currentElapsed()

int QSvgTinyDocument::currentElapsed ( ) const
inline

Definition at line 157 of file qsvgtinydocument_p.h.

References QDateTime::currentMSecsSinceEpoch().

Referenced by QSvgStyle::apply(), QSvgAnimateColor::apply(), currentFrame(), QSvgAnimateTransform::resolveMatrix(), and setCurrentFrame().

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

◆ currentFrame()

int QSvgTinyDocument::currentFrame ( ) const

Definition at line 499 of file qsvgtinydocument.cpp.

References currentElapsed(), and qMin().

+ Here is the call graph for this function:

◆ draw() [1/4]

void QSvgTinyDocument::draw ( QPainter p)

Definition at line 390 of file qsvgtinydocument.cpp.

References draw().

+ Here is the call graph for this function:

◆ draw() [2/4]

◆ draw() [3/4]

◆ draw() [4/4]

void QSvgTinyDocument::draw ( QPainter p,
QSvgExtraStates  
)
overridevirtual

Implements QSvgNode.

Definition at line 395 of file qsvgtinydocument.cpp.

References draw().

Referenced by draw(), and draw().

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

◆ elementExists()

bool QSvgTinyDocument::elementExists ( const QString id) const

Definition at line 471 of file qsvgtinydocument.cpp.

References QSvgStructureNode::scopeNode().

+ Here is the call graph for this function:

◆ height()

int QSvgTinyDocument::height ( ) const
inline

Definition at line 127 of file qsvgtinydocument_p.h.

References QSize::height(), and size().

Referenced by size().

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

◆ heightPercent()

bool QSvgTinyDocument::heightPercent ( ) const
inline

Definition at line 137 of file qsvgtinydocument_p.h.

◆ load() [1/3]

QSvgTinyDocument * QSvgTinyDocument::load ( const QByteArray contents)
static

Definition at line 182 of file qsvgtinydocument.cpp.

References QSvgHandler::animationDuration(), contents, QSvgHandler::document(), QByteArray::isNull(), QSvgHandler::ok(), qt_inflateSvgzDataFrom(), and QIODeviceBase::ReadOnly.

+ Here is the call graph for this function:

◆ load() [2/3]

QSvgTinyDocument * QSvgTinyDocument::load ( const QString file)
static

Definition at line 155 of file qsvgtinydocument.cpp.

References QSvgHandler::animationDuration(), Qt::CaseInsensitive, QSvgHandler::document(), QIODevice::errorString(), QSvgHandler::errorString(), file, fileName, QSvgHandler::lineNumber(), load(), QSvgHandler::ok(), QFile::open(), qCWarning, qPrintable, qt_inflateSvgzDataFrom(), and QIODeviceBase::ReadOnly.

Referenced by load(), and loadDocument().

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

◆ load() [3/3]

QSvgTinyDocument * QSvgTinyDocument::load ( QXmlStreamReader *  contents)
static

Definition at line 211 of file qsvgtinydocument.cpp.

References QSvgHandler::animationDuration(), contents, QSvgHandler::document(), and QSvgHandler::ok().

+ Here is the call graph for this function:

◆ namedNode()

QSvgNode * QSvgTinyDocument::namedNode ( const QString id) const

Definition at line 357 of file qsvgtinydocument.cpp.

References QHash< Key, T >::value().

Referenced by QSvgStructureNode::scopeNode().

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

◆ namedStyle()

QSvgFillStyleProperty * QSvgTinyDocument::namedStyle ( const QString id) const

Definition at line 370 of file qsvgtinydocument.cpp.

References QHash< Key, T >::value().

Referenced by QSvgNode::styleProperty().

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

◆ preserveAspectRatio()

bool QSvgTinyDocument::preserveAspectRatio ( ) const
inline

Definition at line 152 of file qsvgtinydocument_p.h.

◆ restartAnimation()

void QSvgTinyDocument::restartAnimation ( )

Definition at line 375 of file qsvgtinydocument.cpp.

References QDateTime::currentMSecsSinceEpoch().

+ Here is the call graph for this function:

◆ setAnimated()

void QSvgTinyDocument::setAnimated ( bool  a)

Definition at line 385 of file qsvgtinydocument.cpp.

◆ setCurrentFrame()

void QSvgTinyDocument::setCurrentFrame ( int  frame)

Definition at line 508 of file qsvgtinydocument.cpp.

References currentElapsed(), and frame.

+ Here is the call graph for this function:

◆ setFramesPerSecond()

void QSvgTinyDocument::setFramesPerSecond ( int  num)

Definition at line 518 of file qsvgtinydocument.cpp.

◆ setHeight()

void QSvgTinyDocument::setHeight ( int  len,
bool  percent 
)

Definition at line 325 of file qsvgtinydocument.cpp.

References QSize::setHeight().

Referenced by createSvgNode().

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

◆ setPreserveAspectRatio()

void QSvgTinyDocument::setPreserveAspectRatio ( bool  on)

Definition at line 331 of file qsvgtinydocument.cpp.

◆ setViewBox()

void QSvgTinyDocument::setViewBox ( const QRectF rect)

Definition at line 336 of file qsvgtinydocument.cpp.

References rect.

Referenced by createSvgNode().

+ Here is the caller graph for this function:

◆ setWidth()

void QSvgTinyDocument::setWidth ( int  len,
bool  percent 
)

Definition at line 319 of file qsvgtinydocument.cpp.

References QSize::setWidth().

Referenced by createSvgNode().

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

◆ size()

QSize QSvgTinyDocument::size ( ) const
inline

Definition at line 110 of file qsvgtinydocument_p.h.

References height(), QSize::height(), QSize::isEmpty(), qRound(), size(), QRectF::size(), QSizeF::toSize(), viewBox(), width(), and QSize::width().

Referenced by height(), size(), and width().

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

◆ svgFont()

QSvgFont * QSvgTinyDocument::svgFont ( const QString family) const

Definition at line 347 of file qsvgtinydocument.cpp.

Referenced by createFontNode(), parseFont(), parseFontFaceNameNode(), and parseFontFaceNode().

+ Here is the caller graph for this function:

◆ transformForElement()

QTransform QSvgTinyDocument::transformForElement ( const QString id) const

Definition at line 478 of file qsvgtinydocument.cpp.

References QSvgNode::m_style, QSvgNode::parent(), qCDebug, qPrintable, QSvgTransformStyle::qtransform(), QSvgStructureNode::scopeNode(), and QSvgStyle::transform.

+ Here is the call graph for this function:

◆ type()

QSvgNode::Type QSvgTinyDocument::type ( ) const
overridevirtual

Implements QSvgNode.

Definition at line 314 of file qsvgtinydocument.cpp.

References QSvgNode::DOC.

◆ viewBox()

QRectF QSvgTinyDocument::viewBox ( ) const
inline

Definition at line 142 of file qsvgtinydocument_p.h.

References QRectF::isNull(), and QSvgNode::transformedBounds().

Referenced by size().

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

◆ width()

int QSvgTinyDocument::width ( ) const
inline

Definition at line 122 of file qsvgtinydocument_p.h.

References size(), and QSize::width().

Referenced by size().

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

◆ widthPercent()

bool QSvgTinyDocument::widthPercent ( ) const
inline

Definition at line 132 of file qsvgtinydocument_p.h.


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