Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QSvgDocument Class Reference

#include <qsvgdocument_p.h>

Inheritance diagram for QSvgDocument:
Collaboration diagram for QSvgDocument:

Public Member Functions

 QSvgDocument (QtSvg::Options options, QtSvg::AnimatorType type)
 ~QSvgDocument ()
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)
bool isCalculatingImplicitViewBox ()
QtSvg::Options options () const
void drawCommand (QPainter *, 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, QSvgPaintStyleProperty *style)
QSvgPaintStylePropertynamedStyle (const QString &id) const
void restartAnimation ()
qint64 currentElapsed () const
bool animated () const
void setAnimated (bool a)
int animationDuration () const
int currentFrame () const
void setCurrentFrame (int)
void setFramesPerSecond (int num)
QSharedPointer< QSvgAbstractAnimatoranimator () const
Public Member Functions inherited from QSvgStructureNode
 QSvgStructureNode (QSvgNode *parent)
 ~QSvgStructureNode ()
QSvgNodescopeNode (const QString &id) const
void addChild (std::unique_ptr< QSvgNode > child, const QString &id)
QRectF internalBounds (QPainter *p, QSvgExtraStates &states) const override
QRectF decoratedInternalBounds (QPainter *p, QSvgExtraStates &states) const override
QSvgNodepreviousSiblingNode (QSvgNode *n) const
const std::vector< std::unique_ptr< QSvgNode > > & renderers () const
Public Member Functions inherited from QSvgNode
 QSvgNode (QSvgNode *parent=0)
virtual ~QSvgNode ()
void draw (QPainter *p, QSvgExtraStates &states)
virtual bool separateFillStroke (const QSvgExtraStates &) const
void fillThenStroke (QPainter *p, QSvgExtraStates &states)
QImage drawIntoBuffer (QPainter *p, QSvgExtraStates &states, const QRect &boundsRect)
void applyMaskToBuffer (QImage *proxy, QImage mask) const
void drawWithMask (QPainter *p, QSvgExtraStates &states, const QImage &mask, const QRect &boundsRect)
void applyBufferToCanvas (QPainter *p, QImage proxy) const
QSvgNodeparent () const
bool isDescendantOf (const QSvgNode *parent) const
void appendStyleProperty (QSvgStyleProperty *prop, const QString &id)
void applyStyle (QPainter *p, QSvgExtraStates &states) const
void applyStyleRecursive (QPainter *p, QSvgExtraStates &states) const
void revertStyle (QPainter *p, QSvgExtraStates &states) const
void revertStyleRecursive (QPainter *p, QSvgExtraStates &states) const
void applyAnimatedStyle (QPainter *p, QSvgExtraStates &states) const
void revertAnimatedStyle (QPainter *p, QSvgExtraStates &states) const
QSvgStylePropertystyleProperty (QSvgStyleProperty::Type type) const
QSvgPaintStylePropertystyleProperty (QStringView id) const
QSvgDocumentdocument () const
QString typeName () const
virtual QRectF internalFastBounds (QPainter *p, QSvgExtraStates &states) const
QRectF bounds (QPainter *p, QSvgExtraStates &states) const
QRectF bounds () const
virtual QRectF decoratedBounds (QPainter *p, QSvgExtraStates &states) 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)
QString maskId () const
void setMaskId (const QString &str)
bool hasMask () const
QString filterId () const
void setFilterId (const QString &str)
bool hasFilter () const
QString markerStartId () const
void setMarkerStartId (const QString &str)
bool hasMarkerStart () const
QString markerMidId () const
void setMarkerMidId (const QString &str)
bool hasMarkerMid () const
QString markerEndId () const
void setMarkerEndId (const QString &str)
bool hasMarkerEnd () const
bool hasAnyMarker () const
virtual bool requiresGroupRendering () const
virtual bool shouldDrawNode (QPainter *p, QSvgExtraStates &states) const
const QSvgStaticStylestyle () const

Static Public Member Functions

static std::unique_ptr< QSvgDocumentload (const QString &file, QtSvg::Options options={}, QtSvg::AnimatorType type=QtSvg::AnimatorType::Automatic)
static std::unique_ptr< QSvgDocumentload (const QByteArray &contents, QtSvg::Options options={}, QtSvg::AnimatorType type=QtSvg::AnimatorType::Automatic)
static std::unique_ptr< QSvgDocumentload (QXmlStreamReader *contents, QtSvg::Options options={}, QtSvg::AnimatorType type=QtSvg::AnimatorType::Automatic)
static bool isLikelySvg (QIODevice *device, bool *isCompressed=nullptr)

Additional Inherited Members

Public Types inherited from QSvgNode
enum  Type {
  Doc , Group , Defs , Switch ,
  AnimateColor , AnimateTransform , Circle , Ellipse ,
  Image , Line , Path , Polygon ,
  Polyline , Rect , Text , Textarea ,
  Tspan , Use , Video , Mask ,
  Symbol , Marker , Pattern , Filter ,
  FeMerge , FeMergenode , FeColormatrix , FeGaussianblur ,
  FeOffset , FeComposite , FeFlood , FeBlend ,
  FeUnsupported
}
enum  DisplayMode {
  InlineMode , BlockMode , ListItemMode , RunInMode ,
  CompactMode , MarkerMode , TableMode , InlineTableMode ,
  TableRowGroupMode , TableHeaderGroupMode , TableFooterGroupMode , TableRowMode ,
  TableColumnGroupMode , TableColumnMode , TableCellMode , TableCaptionMode ,
  NoneMode , InheritMode
}
Protected Types inherited from QSvgNode
enum  BoundsMode { Simplistic , IncludeMiterLimit }
Protected Member Functions inherited from QSvgNode
QRectF filterRegion (QRectF bounds) const
Static Protected Member Functions inherited from QSvgNode
static qreal strokeWidth (QPainter *p)
static void initPainter (QPainter *p)
static QRectF boundsOnStroke (QPainter *p, const QPainterPath &path, qreal width, BoundsMode mode)
Protected Attributes inherited from QSvgStructureNode
std::vector< std::unique_ptr< QSvgNode > > m_renderers
bool m_recursing = false
Protected Attributes inherited from QSvgNode
QSvgStaticStyle m_style
QSvgAnimatedStyle m_animatedStyle

Detailed Description

Definition at line 40 of file qsvgdocument_p.h.

Constructor & Destructor Documentation

◆ QSvgDocument()

QSvgDocument::QSvgDocument ( QtSvg::Options options,
QtSvg::AnimatorType type )

Definition at line 25 of file qsvgdocument.cpp.

◆ ~QSvgDocument()

QSvgDocument::~QSvgDocument ( )

Definition at line 45 of file qsvgdocument.cpp.

Member Function Documentation

◆ addNamedNode()

void QSvgDocument::addNamedNode ( const QString & id,
QSvgNode * node )

Definition at line 370 of file qsvgdocument.cpp.

◆ addNamedStyle()

void QSvgDocument::addNamedStyle ( const QString & id,
QSvgPaintStyleProperty * style )

Definition at line 380 of file qsvgdocument.cpp.

◆ addSvgFont()

void QSvgDocument::addSvgFont ( QSvgFont * font)

Definition at line 360 of file qsvgdocument.cpp.

◆ animated()

bool QSvgDocument::animated ( ) const

Definition at line 398 of file qsvgdocument.cpp.

◆ animationDuration()

int QSvgDocument::animationDuration ( ) const
inline

Definition at line 181 of file qsvgdocument_p.h.

◆ animator()

QSharedPointer< QSvgAbstractAnimator > QSvgDocument::animator ( ) const

Definition at line 541 of file qsvgdocument.cpp.

◆ boundsOnElement()

QRectF QSvgDocument::boundsOnElement ( const QString & id) const

Definition at line 482 of file qsvgdocument.cpp.

◆ currentElapsed()

qint64 QSvgDocument::currentElapsed ( ) const
inline

Definition at line 176 of file qsvgdocument_p.h.

◆ currentFrame()

int QSvgDocument::currentFrame ( ) const

Definition at line 518 of file qsvgdocument.cpp.

◆ draw() [1/3]

void QSvgDocument::draw ( QPainter * p)

Definition at line 408 of file qsvgdocument.cpp.

◆ draw() [2/3]

void QSvgDocument::draw ( QPainter * p,
const QRectF & bounds )

Definition at line 252 of file qsvgdocument.cpp.

◆ draw() [3/3]

void QSvgDocument::draw ( QPainter * p,
const QString & id,
const QRectF & bounds = QRectF() )

Definition at line 272 of file qsvgdocument.cpp.

◆ drawCommand()

void QSvgDocument::drawCommand ( QPainter * ,
QSvgExtraStates &  )
overridevirtual

Implements QSvgNode.

Definition at line 413 of file qsvgdocument.cpp.

◆ elementExists()

bool QSvgDocument::elementExists ( const QString & id) const

Definition at line 490 of file qsvgdocument.cpp.

◆ height()

int QSvgDocument::height ( ) const
inline

Definition at line 145 of file qsvgdocument_p.h.

◆ heightPercent()

bool QSvgDocument::heightPercent ( ) const
inline

Definition at line 155 of file qsvgdocument_p.h.

◆ isCalculatingImplicitViewBox()

bool QSvgDocument::isCalculatingImplicitViewBox ( )
inline

Definition at line 68 of file qsvgdocument_p.h.

◆ isLikelySvg()

bool QSvgDocument::isLikelySvg ( QIODevice * device,
bool * isCompressed = nullptr )
static

Definition at line 546 of file qsvgdocument.cpp.

◆ load() [1/3]

std::unique_ptr< QSvgDocument > QSvgDocument::load ( const QByteArray & contents,
QtSvg::Options options = {},
QtSvg::AnimatorType type = QtSvg::AnimatorType::Automatic )
static

Definition at line 207 of file qsvgdocument.cpp.

◆ load() [2/3]

std::unique_ptr< QSvgDocument > QSvgDocument::load ( const QString & file,
QtSvg::Options options = {},
QtSvg::AnimatorType type = QtSvg::AnimatorType::Automatic )
static

Definition at line 179 of file qsvgdocument.cpp.

◆ load() [3/3]

std::unique_ptr< QSvgDocument > QSvgDocument::load ( QXmlStreamReader * contents,
QtSvg::Options options = {},
QtSvg::AnimatorType type = QtSvg::AnimatorType::Automatic )
static

Definition at line 237 of file qsvgdocument.cpp.

◆ namedNode()

QSvgNode * QSvgDocument::namedNode ( const QString & id) const

Definition at line 375 of file qsvgdocument.cpp.

◆ namedStyle()

QSvgPaintStyleProperty * QSvgDocument::namedStyle ( const QString & id) const

Definition at line 388 of file qsvgdocument.cpp.

◆ options()

QtSvg::Options QSvgDocument::options ( ) const

◆ preserveAspectRatio()

bool QSvgDocument::preserveAspectRatio ( ) const
inline

Definition at line 171 of file qsvgdocument_p.h.

◆ restartAnimation()

void QSvgDocument::restartAnimation ( )

Definition at line 393 of file qsvgdocument.cpp.

◆ setAnimated()

void QSvgDocument::setAnimated ( bool a)

Definition at line 403 of file qsvgdocument.cpp.

◆ setCurrentFrame()

void QSvgDocument::setCurrentFrame ( int frame)

Definition at line 525 of file qsvgdocument.cpp.

◆ setFramesPerSecond()

void QSvgDocument::setFramesPerSecond ( int num)

Definition at line 536 of file qsvgdocument.cpp.

◆ setHeight()

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

Definition at line 338 of file qsvgdocument.cpp.

◆ setPreserveAspectRatio()

void QSvgDocument::setPreserveAspectRatio ( bool on)

Definition at line 344 of file qsvgdocument.cpp.

◆ setViewBox()

void QSvgDocument::setViewBox ( const QRectF & rect)

Definition at line 349 of file qsvgdocument.cpp.

◆ setWidth()

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

Definition at line 332 of file qsvgdocument.cpp.

◆ size()

QSize QSvgDocument::size ( ) const
inline

Definition at line 128 of file qsvgdocument_p.h.

◆ svgFont()

QSvgFont * QSvgDocument::svgFont ( const QString & family) const

Definition at line 365 of file qsvgdocument.cpp.

◆ transformForElement()

QTransform QSvgDocument::transformForElement ( const QString & id) const

Definition at line 497 of file qsvgdocument.cpp.

◆ type()

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

Implements QSvgNode.

Definition at line 327 of file qsvgdocument.cpp.

◆ viewBox()

QRectF QSvgDocument::viewBox ( ) const
inline

Definition at line 160 of file qsvgdocument_p.h.

◆ width()

int QSvgDocument::width ( ) const
inline

Definition at line 140 of file qsvgdocument_p.h.

◆ widthPercent()

bool QSvgDocument::widthPercent ( ) const
inline

Definition at line 150 of file qsvgdocument_p.h.


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