Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSvgTinyDocument Class Reference

#include <qsvgtinydocument_p.h>

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

Public Member Functions

 QSvgTinyDocument (QtSvg::Options options)
 
 ~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)
 
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 ()
 
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 ()
 
void draw (QPainter *p, QSvgExtraStates &states)
 
virtual bool separateFillStroke () 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
 
QSvgStylePropertystyleProperty (QSvgStyleProperty::Type type) const
 
QSvgPaintStylePropertystyleProperty (const QString &id) const
 
QSvgTinyDocumentdocument () const
 
QString typeName () const
 
virtual QRectF fastBounds (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)
 
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 shouldDrawNode (QPainter *p, QSvgExtraStates &states) const
 
const QSvgStylestyle () const
 

Static Public Member Functions

static QSvgTinyDocumentload (const QString &file, QtSvg::Options options={})
 
static QSvgTinyDocumentload (const QByteArray &contents, QtSvg::Options options={})
 
static QSvgTinyDocumentload (QXmlStreamReader *contents, QtSvg::Options options={})
 
static bool isLikelySvg (QIODevice *device, bool *isCompressed=nullptr)
 

Additional Inherited Members

- Public Types inherited from QSvgNode
enum  Type {
  Doc , Group , Defs , Switch ,
  Animation , 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 , FeUnsupported
}
 
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)
 
static void initPainter (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()

QSvgTinyDocument::QSvgTinyDocument ( QtSvg::Options options)

Definition at line 26 of file qsvgtinydocument.cpp.

◆ ~QSvgTinyDocument()

QSvgTinyDocument::~QSvgTinyDocument ( )

Definition at line 38 of file qsvgtinydocument.cpp.

Member Function Documentation

◆ addNamedNode()

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

Definition at line 366 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,
QSvgPaintStyleProperty * style )

Definition at line 376 of file qsvgtinydocument.cpp.

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

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 356 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 394 of file qsvgtinydocument.cpp.

Referenced by QSvgRendererPrivate::startOrStopTimer().

+ Here is the caller graph for this function:

◆ animationDuration()

int QSvgTinyDocument::animationDuration ( ) const
inline

Definition at line 170 of file qsvgtinydocument_p.h.

◆ boundsOnElement()

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

Definition at line 478 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 165 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 514 of file qsvgtinydocument.cpp.

References currentElapsed(), and qMin().

+ Here is the call graph for this function:

◆ draw() [1/3]

void QSvgTinyDocument::draw ( QPainter * p)

Definition at line 404 of file qsvgtinydocument.cpp.

References draw().

Referenced by draw().

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

◆ draw() [2/3]

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

Definition at line 240 of file qsvgtinydocument.cpp.

References QSvgNode::applyStyle(), QList< T >::begin(), QSvgStructureNode::bounds(), QDateTime::currentMSecsSinceEpoch(), QSvgNode::displayMode(), QSvgNode::draw(), QList< T >::end(), QSvgNode::initPainter(), QSvgNode::isVisible(), QSvgStructureNode::m_renderers, QSvgNode::NoneMode, and QSvgNode::revertStyle().

+ Here is the call graph for this function:

◆ draw() [3/3]

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

◆ drawCommand()

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

Implements QSvgNode.

Definition at line 409 of file qsvgtinydocument.cpp.

References qCDebug.

◆ elementExists()

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

Definition at line 486 of file qsvgtinydocument.cpp.

References QSvgStructureNode::scopeNode().

+ Here is the call graph for this function:

◆ height()

int QSvgTinyDocument::height ( ) const
inline

Definition at line 135 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 145 of file qsvgtinydocument_p.h.

◆ isLikelySvg()

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

Definition at line 538 of file qsvgtinydocument.cpp.

References device, QByteArray::fromRawData(), hasSvgHeader(), and inflate().

Referenced by QSvgIOHandler::canRead(), and QSvgIOHandler::canRead().

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

◆ load() [1/3]

QSvgTinyDocument * QSvgTinyDocument::load ( const QByteArray & contents,
QtSvg::Options options = {} )
static

Definition at line 197 of file qsvgtinydocument.cpp.

References QSvgHandler::animationDuration(), contents, QSvgHandler::document(), QSvgHandler::ok(), options(), qt_inflateSvgzDataFrom(), QIODeviceBase::ReadOnly, and QBuffer::setData().

+ Here is the call graph for this function:

◆ load() [2/3]

QSvgTinyDocument * QSvgTinyDocument::load ( const QString & file,
QtSvg::Options options = {} )
static

Definition at line 170 of file qsvgtinydocument.cpp.

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

Referenced by load(), loadDocument(), and QSvgVisitorImpl::traverse().

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

◆ load() [3/3]

QSvgTinyDocument * QSvgTinyDocument::load ( QXmlStreamReader * contents,
QtSvg::Options options = {} )
static

Definition at line 226 of file qsvgtinydocument.cpp.

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

+ Here is the call graph for this function:

◆ namedNode()

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

Definition at line 371 of file qsvgtinydocument.cpp.

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

Referenced by QSvgMask::createMask(), QSvgNode::draw(), QSvgMarker::drawMarkersForNode(), and QSvgStructureNode::scopeNode().

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

◆ namedStyle()

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

Definition at line 384 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:

◆ options()

QtSvg::Options QSvgTinyDocument::options ( ) const

Definition at line 351 of file qsvgtinydocument.cpp.

Referenced by load(), load(), and load().

+ Here is the caller graph for this function:

◆ preserveAspectRatio()

bool QSvgTinyDocument::preserveAspectRatio ( ) const
inline

Definition at line 160 of file qsvgtinydocument_p.h.

◆ restartAnimation()

void QSvgTinyDocument::restartAnimation ( )

Definition at line 389 of file qsvgtinydocument.cpp.

References QDateTime::currentMSecsSinceEpoch().

+ Here is the call graph for this function:

◆ setAnimated()

void QSvgTinyDocument::setAnimated ( bool a)

Definition at line 399 of file qsvgtinydocument.cpp.

Referenced by parseAnimateColorNode(), and parseAnimateTransformNode().

+ Here is the caller graph for this function:

◆ setCurrentFrame()

void QSvgTinyDocument::setCurrentFrame ( int frame)

Definition at line 523 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 533 of file qsvgtinydocument.cpp.

◆ setHeight()

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

Definition at line 334 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 340 of file qsvgtinydocument.cpp.

◆ setViewBox()

void QSvgTinyDocument::setViewBox ( const QRectF & rect)

Definition at line 345 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 328 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 118 of file qsvgtinydocument_p.h.

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

Referenced by height(), size(), QSvgVisitorImpl::visitDocumentNodeStart(), width(), and SvgDebugVisitor::write().

+ 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 361 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 493 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 323 of file qsvgtinydocument.cpp.

References QSvgNode::Doc.

Referenced by QSvgVisitorImpl::visitDocumentNodeEnd().

+ Here is the caller graph for this function:

◆ viewBox()

QRectF QSvgTinyDocument::viewBox ( ) const
inline

Definition at line 150 of file qsvgtinydocument_p.h.

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

Referenced by createMaskNode(), createPatternNode(), QSvgFeFilterPrimitive::localFilterBoundingBox(), parseSymbolLikeAttributes(), size(), QSvgVisitorImpl::visitDocumentNodeStart(), and SvgDebugVisitor::write().

+ 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 130 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 140 of file qsvgtinydocument_p.h.


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