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
qsvghandler.cpp File Reference

(2ac47bde220a62327f18b3dddd2b8b24a5afa541)

#include "qplatformdefs.h"
#include "qsvghandler_p.h"
#include "qsvgtinydocument_p.h"
#include "qsvgstructure_p.h"
#include "qsvggraphics_p.h"
#include "qsvgfilter_p.h"
#include "qsvgnode_p.h"
#include "qsvgfont_p.h"
#include "qsvganimate_p.h"
#include "qpen.h"
#include "qpainterpath.h"
#include "qbrush.h"
#include "qcolor.h"
#include "qtextformat.h"
#include <QtCore/private/qdataurl_p.h>
#include "qlist.h"
#include "qfileinfo.h"
#include "qfile.h"
#include "qdir.h"
#include "qdebug.h"
#include "qmath.h"
#include "qnumeric.h"
#include <qregularexpression.h>
#include "qtransform.h"
#include "qvarlengtharray.h"
#include "private/qmath_p.h"
#include "qimagereader.h"
#include "float.h"
Include dependency graph for qsvghandler.cpp:

Go to the source code of this file.

Classes

struct  QSvgAttributes

Macros

#define QT_INHERIT   QLatin1String(qt_inherit_text)
#define NOOP   qDebug()<<"Operation: "<<op<<" is not implemented"

Typedefs

typedef QSvgNode *(* FactoryMethod) (QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *)
typedef QSvgNode *(* AnimationMethod) (QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *)
typedef bool(* ParseMethod) (QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *)
typedef QSvgStyleProperty *(* StyleFactoryMethod) (QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *)
typedef bool(* StyleParseMethod) (QSvgStyleProperty *, const QXmlStreamAttributes &, QSvgHandler *)

Enumerations

enum  FontSizeSpec {
  XXSmall , XSmall , Small , Medium ,
  Large , XLarge , XXLarge , FontSizeNone ,
  FontSizeValue , XXSmall , XSmall , Small ,
  Medium , Large , XLarge , XXLarge ,
  FontSizeNone , FontSizeValue
}
enum  FontSizeSpec {
  XXSmall , XSmall , Small , Medium ,
  Large , XLarge , XXLarge , FontSizeNone ,
  FontSizeValue , XXSmall , XSmall , Small ,
  Medium , Large , XLarge , XXLarge ,
  FontSizeNone , FontSizeValue
}

Functions

static QByteArray prefixMessage (const QByteArray &msg, const QXmlStreamReader *r)
static QByteArray msgProblemParsing (QStringView localName, const QXmlStreamReader *r)
static QByteArray msgCouldNotResolveProperty (QStringView id, const QXmlStreamReader *r)
static QList< QStringViewsplitWithDelimiter (QStringView delimitedList)
static int qsvg_h2i (char hex, bool *ok=nullptr)
static int qsvg_hex2int (const char *s, bool *ok=nullptr)
static int qsvg_hex2int (char s, bool *ok=nullptr)
bool qsvg_get_hex_rgb (const char *name, QRgb *rgb)
bool qsvg_get_hex_rgb (const QChar *str, int len, QRgb *rgb)
static bool parsePathDataFast (QStringView data, QPainterPath &path, bool limitLength=true)
static QString someId (const QXmlStreamAttributes &attributes)
static QList< qrealparseNumbersList (const QChar *&str)
static void parseNumbersArray (const QChar *&str, QVarLengthArray< qreal, 8 > &points, const char *pattern=nullptr)
static QList< qrealparsePercentageList (const QChar *&str)
static QStringView idFromUrl (QStringView url)
static bool resolveColor (QStringView colorStr, QColor &color, QSvgHandler *handler)
static bool constructColor (QStringView colorStr, QStringView opacity, QColor &color, QSvgHandler *handler)
static qreal convertToNumber (QStringView str, bool *ok=NULL)
static bool createSvgGlyph (QSvgFont *font, const QXmlStreamAttributes &attributes, bool isMissingGlyph)
static void parseColor (QSvgNode *, const QSvgAttributes &attributes, QSvgHandler *handler)
static QSvgStylePropertystyleFromUrl (QSvgNode *node, QStringView url)
static void parseBrush (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *handler)
static QTransform parseTransformationMatrix (QStringView value)
static void parsePen (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *handler)
 Q_STATIC_ASSERT (sizeof(sizeTable)/sizeof(sizeTable[0])==FontSizeNone)
static FontSizeSpec fontSizeSpec (QStringView spec)
static void parseFont (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *)
static void parseTransform (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *)
static void parseVisibility (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *)
static void pathArcSegment (QPainterPath &path, qreal xc, qreal yc, qreal th0, qreal th1, qreal rx, qreal ry, qreal xAxisRotation)
static void pathArc (QPainterPath &path, qreal rx, qreal ry, qreal x_axis_rotation, int large_arc_flag, int sweep_flag, qreal x, qreal y, qreal curx, qreal cury)
static bool parseStyle (QSvgNode *node, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static int parseClockValue (QStringView str, bool *ok)
static void parseCssAnimations (QSvgNode *node, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QStringList stringToList (const QString &str)
static bool parseCoreNode (QSvgNode *node, const QXmlStreamAttributes &attributes)
static void parseOpacity (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *)
static QPainter::CompositionMode svgToQtCompositionMode (const QStringView op)
static void parseCompOp (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *)
static QSvgNode::DisplayMode displayStringToEnum (const QStringView str)
static void parseOthers (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *)
static std::optional< QStringViewgetAttributeId (const QStringView &attribute)
static void parseExtendedAttributes (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *handler)
static void parseRenderingHints (QSvgNode *node, const QSvgAttributes &attributes, QSvgHandler *)
static bool parseAnchorNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseBaseAnimate (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgAnimateNode *anim, QSvgHandler *handler)
static void generateKeyFrames (QList< qreal > &keyFrames, uint count)
static QSvgNodecreateAnimateColorNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreateAimateMotionNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static void parseNumberTriplet (QList< qreal > &values, const QChar *&s)
static QSvgNodecreateAnimateTransformNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreateAnimateNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseAudioNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateCircleNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateDefsNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseDiscardNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateEllipseNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgStylePropertycreateFontNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseFontFaceNode (QSvgStyleProperty *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseFontFaceNameNode (QSvgStyleProperty *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseFontFaceSrcNode (QSvgStyleProperty *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseFontFaceUriNode (QSvgStyleProperty *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseForeignObjectNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateGNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseGlyphNode (QSvgStyleProperty *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseHandlerNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseHkernNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateImageNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreateLineNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static void parseBaseGradient (QSvgNode *node, const QXmlStreamAttributes &attributes, QSvgGradientStyle *gradProp, QSvgHandler *handler)
static QSvgStylePropertycreateLinearGradientNode (QSvgNode *node, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static bool parseMetadataNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseMissingGlyphNode (QSvgStyleProperty *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseMpathNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseMaskNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseMarkerNode (QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *)
static QSvgNodecreateMaskNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static void parseFilterBounds (const QXmlStreamAttributes &attributes, QSvgRectF *rect)
static QSvgNodecreateFilterNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static void parseFilterAttributes (const QXmlStreamAttributes &attributes, QString *inString, QString *outString, QSvgRectF *rect)
static QSvgNodecreateFeColorMatrixNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateFeGaussianBlurNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateFeOffsetNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateFeCompositeNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateFeMergeNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateFeFloodNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreateFeMergeNodeNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateFeBlendNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateFeUnsupportedNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static std::optional< QRectFparseViewBox (QStringView str)
static bool parseSymbolLikeAttributes (const QXmlStreamAttributes &attributes, QSvgHandler *handler, QRectF *rect, QRectF *viewBox, QPointF *refPoint, QSvgSymbolLike::PreserveAspectRatios *aspect, QSvgSymbolLike::Overflow *overflow, bool marker=false)
static QSvgNodecreateSymbolNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreateMarkerNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreatePathNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreatePolyNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, bool createLine)
static QSvgNodecreatePolygonNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreatePolylineNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parsePrefetchNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgStylePropertycreateRadialGradientNode (QSvgNode *node, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreateRectNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseScriptNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static bool parseSetNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgStylePropertycreateSolidColorNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static bool parseStopNode (QSvgStyleProperty *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static bool parseStyleNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreateSvgNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreateSwitchNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreatePatternNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static bool parseTbreakNode (QSvgNode *parent, const QXmlStreamAttributes &, QSvgHandler *)
static QSvgNodecreateTextNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateTextAreaNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *handler)
static QSvgNodecreateTspanNode (QSvgNode *parent, const QXmlStreamAttributes &, QSvgHandler *)
static QSvgNodecreateUseNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static QSvgNodecreateVideoNode (QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *)
static FactoryMethod findGroupFactory (const QStringView name, QtSvg::Options options)
static FactoryMethod findGraphicsFactory (const QStringView name, QtSvg::Options options)
static FactoryMethod findFilterFactory (const QStringView name, QtSvg::Options options)
static AnimationMethod findAnimationFactory (const QStringView name, QtSvg::Options options)
static ParseMethod findUtilFactory (const QStringView name, QtSvg::Options options)
static StyleFactoryMethod findStyleFactoryMethod (const QStringView name)
static StyleParseMethod findStyleUtilFactoryMethod (const QStringView name)
static bool detectPatternCycles (const QSvgNode *node, QList< const QSvgNode * > active={})
static bool detectCycles (const QSvgNode *node, QList< const QSvgNode * > active={})
static bool detectCyclesAndWarn (const QSvgNode *node)

Variables

static QT_BEGIN_NAMESPACE const char * qt_inherit_text = "inherit"
static const qreal sizeTable []
static const int unfinishedElementsLimit = 2048

Macro Definition Documentation

◆ NOOP

#define NOOP   qDebug()<<"Operation: "<<op<<" is not implemented"

◆ QT_INHERIT

#define QT_INHERIT   QLatin1String(qt_inherit_text)

Definition at line 44 of file qsvghandler.cpp.

Typedef Documentation

◆ AnimationMethod

typedef QSvgNode *(* AnimationMethod)(QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *)

Definition at line 3838 of file qsvghandler.cpp.

◆ FactoryMethod

typedef QSvgNode *(* FactoryMethod)(QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *)

Definition at line 3714 of file qsvghandler.cpp.

◆ ParseMethod

typedef bool(* ParseMethod)(QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *)

Definition at line 3861 of file qsvghandler.cpp.

◆ StyleFactoryMethod

typedef QSvgStyleProperty *(* StyleFactoryMethod)(QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *)

Definition at line 3907 of file qsvghandler.cpp.

◆ StyleParseMethod

typedef bool(* StyleParseMethod)(QSvgStyleProperty *, const QXmlStreamAttributes &, QSvgHandler *)

Definition at line 3936 of file qsvghandler.cpp.

Enumeration Type Documentation

◆ FontSizeSpec [1/2]

Enumerator
XXSmall 
XSmall 
Small 
Medium 
Large 
XLarge 
XXLarge 
FontSizeNone 
FontSizeValue 
XXSmall 
XSmall 
Small 
Medium 
Large 
XLarge 
XXLarge 
FontSizeNone 
FontSizeValue 

Definition at line 873 of file qsvghandler.cpp.

◆ FontSizeSpec [2/2]

Enumerator
XXSmall 
XSmall 
Small 
Medium 
Large 
XLarge 
XXLarge 
FontSizeNone 
FontSizeValue 
XXSmall 
XSmall 
Small 
Medium 
Large 
XLarge 
XXLarge 
FontSizeNone 
FontSizeValue 

Definition at line 873 of file qsvghandler.cpp.

Function Documentation

◆ constructColor()

bool constructColor ( QStringView colorStr,
QStringView opacity,
QColor & color,
QSvgHandler * handler )
static

Definition at line 516 of file qsvghandler.cpp.

◆ convertToNumber()

qreal convertToNumber ( QStringView str,
bool * ok = NULL )
inlinestatic

Definition at line 531 of file qsvghandler.cpp.

References QSvgUtils::LT_PERCENT.

◆ createAimateMotionNode()

QSvgNode * createAimateMotionNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 1979 of file qsvghandler.cpp.

◆ createAnimateColorNode()

QSvgNode * createAnimateColorNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 1932 of file qsvghandler.cpp.

◆ createAnimateNode()

QSvgNode * createAnimateNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2096 of file qsvghandler.cpp.

◆ createAnimateTransformNode()

QSvgNode * createAnimateTransformNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 1995 of file qsvghandler.cpp.

◆ createCircleNode()

QSvgNode * createCircleNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2112 of file qsvghandler.cpp.

◆ createDefsNode()

QSvgNode * createDefsNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2130 of file qsvghandler.cpp.

◆ createEllipseNode()

QSvgNode * createEllipseNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2147 of file qsvghandler.cpp.

◆ createFeBlendNode()

QSvgNode * createFeBlendNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2959 of file qsvghandler.cpp.

◆ createFeColorMatrixNode()

QSvgNode * createFeColorMatrixNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2738 of file qsvghandler.cpp.

◆ createFeCompositeNode()

QSvgNode * createFeCompositeNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2850 of file qsvghandler.cpp.

◆ createFeFloodNode()

QSvgNode * createFeFloodNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 2919 of file qsvghandler.cpp.

◆ createFeGaussianBlurNode()

QSvgNode * createFeGaussianBlurNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2783 of file qsvghandler.cpp.

◆ createFeMergeNode()

QSvgNode * createFeMergeNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2905 of file qsvghandler.cpp.

◆ createFeMergeNodeNode()

QSvgNode * createFeMergeNodeNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2945 of file qsvghandler.cpp.

◆ createFeOffsetNode()

QSvgNode * createFeOffsetNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2816 of file qsvghandler.cpp.

References QSvgUtils::LT_PT.

◆ createFeUnsupportedNode()

QSvgNode * createFeUnsupportedNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2987 of file qsvghandler.cpp.

◆ createFilterNode()

QSvgNode * createFilterNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 2684 of file qsvghandler.cpp.

References QtSvg::objectBoundingBox, and QtSvg::userSpaceOnUse.

◆ createFontNode()

QSvgStyleProperty * createFontNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2165 of file qsvghandler.cpp.

◆ createGNode()

QSvgNode * createGNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2265 of file qsvghandler.cpp.

◆ createImageNode()

QSvgNode * createImageNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 2303 of file qsvghandler.cpp.

References QtSvg::Tiny12FeaturesOnly.

◆ createLinearGradientNode()

QSvgStyleProperty * createLinearGradientNode ( QSvgNode * node,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 2462 of file qsvghandler.cpp.

◆ createLineNode()

QSvgNode * createLineNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2383 of file qsvghandler.cpp.

◆ createMarkerNode()

QSvgNode * createMarkerNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 3156 of file qsvghandler.cpp.

◆ createMaskNode()

QSvgNode * createMaskNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

◆ createPathNode()

QSvgNode * createPathNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 3202 of file qsvghandler.cpp.

◆ createPatternNode()

QSvgNode * createPatternNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

◆ createPolygonNode()

QSvgNode * createPolygonNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3235 of file qsvghandler.cpp.

◆ createPolylineNode()

QSvgNode * createPolylineNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3242 of file qsvghandler.cpp.

◆ createPolyNode()

QSvgNode * createPolyNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
bool createLine )
static

Definition at line 3217 of file qsvghandler.cpp.

◆ createRadialGradientNode()

QSvgStyleProperty * createRadialGradientNode ( QSvgNode * node,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 3257 of file qsvghandler.cpp.

◆ createRectNode()

QSvgNode * createRectNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3296 of file qsvghandler.cpp.

References QSvgUtils::toDouble().

Here is the call graph for this function:

◆ createSolidColorNode()

QSvgStyleProperty * createSolidColorNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 3363 of file qsvghandler.cpp.

◆ createSvgGlyph()

bool createSvgGlyph ( QSvgFont * font,
const QXmlStreamAttributes & attributes,
bool isMissingGlyph )
static

Definition at line 541 of file qsvghandler.cpp.

◆ createSvgNode()

QSvgNode * createSvgNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 3470 of file qsvghandler.cpp.

References QSvgUtils::LT_PERCENT, QSvgUtils::LT_PT, and QSvgUtils::LT_PX.

◆ createSwitchNode()

QSvgNode * createSwitchNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3512 of file qsvghandler.cpp.

◆ createSymbolNode()

QSvgNode * createSymbolNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 3139 of file qsvghandler.cpp.

◆ createTextAreaNode()

QSvgNode * createTextAreaNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 3632 of file qsvghandler.cpp.

◆ createTextNode()

QSvgNode * createTextNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3615 of file qsvghandler.cpp.

◆ createTspanNode()

QSvgNode * createTspanNode ( QSvgNode * parent,
const QXmlStreamAttributes & ,
QSvgHandler *  )
static

Definition at line 3646 of file qsvghandler.cpp.

◆ createUseNode()

QSvgNode * createUseNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3653 of file qsvghandler.cpp.

◆ createVideoNode()

QSvgNode * createVideoNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3706 of file qsvghandler.cpp.

◆ detectCycles()

bool detectCycles ( const QSvgNode * node,
QList< const QSvgNode * > active = {} )
static

Definition at line 4030 of file qsvghandler.cpp.

◆ detectCyclesAndWarn()

bool detectCyclesAndWarn ( const QSvgNode * node)
static

Definition at line 4081 of file qsvghandler.cpp.

◆ detectPatternCycles()

bool detectPatternCycles ( const QSvgNode * node,
QList< const QSvgNode * > active = {} )
static

Definition at line 4009 of file qsvghandler.cpp.

◆ displayStringToEnum()

QSvgNode::DisplayMode displayStringToEnum ( const QStringView str)
static

Definition at line 1719 of file qsvghandler.cpp.

◆ findAnimationFactory()

AnimationMethod findAnimationFactory ( const QStringView name,
QtSvg::Options options )
static

Definition at line 3840 of file qsvghandler.cpp.

References QtSvg::DisableSMILAnimations.

◆ findFilterFactory()

FactoryMethod findFilterFactory ( const QStringView name,
QtSvg::Options options )
static

Definition at line 3795 of file qsvghandler.cpp.

References QtSvg::Tiny12FeaturesOnly.

◆ findGraphicsFactory()

FactoryMethod findGraphicsFactory ( const QStringView name,
QtSvg::Options options )
static

Definition at line 3750 of file qsvghandler.cpp.

◆ findGroupFactory()

FactoryMethod findGroupFactory ( const QStringView name,
QtSvg::Options options )
static

Definition at line 3716 of file qsvghandler.cpp.

References QtSvg::Tiny12FeaturesOnly.

◆ findStyleFactoryMethod()

StyleFactoryMethod findStyleFactoryMethod ( const QStringView name)
static

Definition at line 3911 of file qsvghandler.cpp.

◆ findStyleUtilFactoryMethod()

StyleParseMethod findStyleUtilFactoryMethod ( const QStringView name)
static

Definition at line 3940 of file qsvghandler.cpp.

References parseFontFaceNameNode(), parseFontFaceNode(), parseFontFaceSrcNode(), parseFontFaceUriNode(), parseGlyphNode(), parseMissingGlyphNode(), and parseStopNode().

Here is the call graph for this function:

◆ findUtilFactory()

ParseMethod findUtilFactory ( const QStringView name,
QtSvg::Options options )
static

Definition at line 3863 of file qsvghandler.cpp.

References QtSvg::Tiny12FeaturesOnly.

◆ fontSizeSpec()

FontSizeSpec fontSizeSpec ( QStringView spec)
static

Definition at line 881 of file qsvghandler.cpp.

References FontSizeNone, FontSizeValue, Large, Medium, Small, XLarge, XSmall, XXLarge, and XXSmall.

◆ generateKeyFrames()

void generateKeyFrames ( QList< qreal > & keyFrames,
uint count )
static

Definition at line 1921 of file qsvghandler.cpp.

◆ getAttributeId()

std::optional< QStringView > getAttributeId ( const QStringView & attribute)
static

Definition at line 1774 of file qsvghandler.cpp.

◆ idFromUrl()

QStringView idFromUrl ( QStringView url)
static

Definition at line 429 of file qsvghandler.cpp.

◆ msgCouldNotResolveProperty()

QByteArray msgCouldNotResolveProperty ( QStringView id,
const QXmlStreamReader * r )
inlinestatic

Definition at line 71 of file qsvghandler.cpp.

◆ msgProblemParsing()

QByteArray msgProblemParsing ( QStringView localName,
const QXmlStreamReader * r )
inlinestatic

Definition at line 66 of file qsvghandler.cpp.

◆ parseAnchorNode()

bool parseAnchorNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 1864 of file qsvghandler.cpp.

◆ parseAudioNode()

bool parseAudioNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2104 of file qsvghandler.cpp.

◆ parseBaseAnimate()

bool parseBaseAnimate ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgAnimateNode * anim,
QSvgHandler * handler )
static

Definition at line 1872 of file qsvghandler.cpp.

◆ parseBaseGradient()

void parseBaseGradient ( QSvgNode * node,
const QXmlStreamAttributes & attributes,
QSvgGradientStyle * gradProp,
QSvgHandler * handler )
static

Definition at line 2402 of file qsvghandler.cpp.

◆ parseBrush()

void parseBrush ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 583 of file qsvghandler.cpp.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parseClockValue()

int parseClockValue ( QStringView str,
bool * ok )
static

Definition at line 1513 of file qsvghandler.cpp.

◆ parseColor()

void parseColor ( QSvgNode * ,
const QSvgAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 567 of file qsvghandler.cpp.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parseCompOp()

void parseCompOp ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler *  )
static

Definition at line 1705 of file qsvghandler.cpp.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parseCoreNode()

bool parseCoreNode ( QSvgNode * node,
const QXmlStreamAttributes & attributes )
static

Definition at line 1579 of file qsvghandler.cpp.

◆ parseCssAnimations()

void parseCssAnimations ( QSvgNode * node,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 1536 of file qsvghandler.cpp.

◆ parseDiscardNode()

bool parseDiscardNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2139 of file qsvghandler.cpp.

◆ parseExtendedAttributes()

void parseExtendedAttributes ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 1789 of file qsvghandler.cpp.

References QtSvg::Tiny12FeaturesOnly.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parseFilterAttributes()

void parseFilterAttributes ( const QXmlStreamAttributes & attributes,
QString * inString,
QString * outString,
QSvgRectF * rect )
static

Definition at line 2719 of file qsvghandler.cpp.

References QtSvg::unknown.

◆ parseFilterBounds()

void parseFilterBounds ( const QXmlStreamAttributes & attributes,
QSvgRectF * rect )
static

◆ parseFont()

void parseFont ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler *  )
static

Definition at line 916 of file qsvghandler.cpp.

References FontSizeNone, and FontSizeValue.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parseFontFaceNameNode()

bool parseFontFaceNameNode ( QSvgStyleProperty * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2219 of file qsvghandler.cpp.

Referenced by findStyleUtilFactoryMethod().

Here is the caller graph for this function:

◆ parseFontFaceNode()

bool parseFontFaceNode ( QSvgStyleProperty * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2191 of file qsvghandler.cpp.

Referenced by findStyleUtilFactoryMethod().

Here is the caller graph for this function:

◆ parseFontFaceSrcNode()

bool parseFontFaceSrcNode ( QSvgStyleProperty * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2241 of file qsvghandler.cpp.

Referenced by findStyleUtilFactoryMethod().

Here is the caller graph for this function:

◆ parseFontFaceUriNode()

bool parseFontFaceUriNode ( QSvgStyleProperty * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2249 of file qsvghandler.cpp.

Referenced by findStyleUtilFactoryMethod().

Here is the caller graph for this function:

◆ parseForeignObjectNode()

bool parseForeignObjectNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2257 of file qsvghandler.cpp.

◆ parseGlyphNode()

bool parseGlyphNode ( QSvgStyleProperty * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2274 of file qsvghandler.cpp.

Referenced by findStyleUtilFactoryMethod().

Here is the caller graph for this function:

◆ parseHandlerNode()

bool parseHandlerNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2287 of file qsvghandler.cpp.

◆ parseHkernNode()

bool parseHkernNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2295 of file qsvghandler.cpp.

◆ parseMarkerNode()

bool parseMarkerNode ( QSvgNode * ,
const QXmlStreamAttributes & ,
QSvgHandler *  )
static

Definition at line 2535 of file qsvghandler.cpp.

◆ parseMaskNode()

bool parseMaskNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2527 of file qsvghandler.cpp.

◆ parseMetadataNode()

bool parseMetadataNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2498 of file qsvghandler.cpp.

◆ parseMissingGlyphNode()

bool parseMissingGlyphNode ( QSvgStyleProperty * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2506 of file qsvghandler.cpp.

Referenced by findStyleUtilFactoryMethod().

Here is the caller graph for this function:

◆ parseMpathNode()

bool parseMpathNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 2519 of file qsvghandler.cpp.

◆ parseNumbersArray()

void parseNumbersArray ( const QChar *& str,
QVarLengthArray< qreal, 8 > & points,
const char * pattern = nullptr )
inlinestatic

Definition at line 367 of file qsvghandler.cpp.

References QSvgUtils::isDigit().

Here is the call graph for this function:

◆ parseNumbersList()

QList< qreal > parseNumbersList ( const QChar *& str)
static

Definition at line 339 of file qsvghandler.cpp.

References QSvgUtils::isDigit().

Here is the call graph for this function:

◆ parseNumberTriplet()

void parseNumberTriplet ( QList< qreal > & values,
const QChar *& s )
static

Definition at line 1987 of file qsvghandler.cpp.

◆ parseOpacity()

void parseOpacity ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler *  )
static

Definition at line 1629 of file qsvghandler.cpp.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parseOthers()

void parseOthers ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler *  )
static

Definition at line 1761 of file qsvghandler.cpp.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parsePathDataFast()

bool parsePathDataFast ( QStringView data,
QPainterPath & path,
bool limitLength = true )
static

Definition at line 1181 of file qsvghandler.cpp.

◆ parsePen()

void parsePen ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 761 of file qsvghandler.cpp.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parsePercentageList()

QList< qreal > parsePercentageList ( const QChar *& str)
static

Definition at line 398 of file qsvghandler.cpp.

◆ parsePrefetchNode()

bool parsePrefetchNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3249 of file qsvghandler.cpp.

◆ parseRenderingHints()

void parseRenderingHints ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler *  )
static

Definition at line 1808 of file qsvghandler.cpp.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parseScriptNode()

bool parseScriptNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3347 of file qsvghandler.cpp.

◆ parseSetNode()

bool parseSetNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler *  )
static

Definition at line 3355 of file qsvghandler.cpp.

◆ parseStopNode()

bool parseStopNode ( QSvgStyleProperty * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 3381 of file qsvghandler.cpp.

Referenced by findStyleUtilFactoryMethod().

Here is the caller graph for this function:

◆ parseStyle()

bool parseStyle ( QSvgNode * node,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 1826 of file qsvghandler.cpp.

References QtSvg::DisableCSSAnimations, parseBrush(), parseColor(), parseCompOp(), parseExtendedAttributes(), parseFont(), parseOpacity(), parseOthers(), parsePen(), parseRenderingHints(), parseTransform(), and parseVisibility().

Here is the call graph for this function:

◆ parseStyleNode()

bool parseStyleNode ( QSvgNode * parent,
const QXmlStreamAttributes & attributes,
QSvgHandler * handler )
static

Definition at line 3453 of file qsvghandler.cpp.

◆ parseSymbolLikeAttributes()

bool parseSymbolLikeAttributes ( const QXmlStreamAttributes & attributes,
QSvgHandler * handler,
QRectF * rect,
QRectF * viewBox,
QPointF * refPoint,
QSvgSymbolLike::PreserveAspectRatios * aspect,
QSvgSymbolLike::Overflow * overflow,
bool marker = false )
static

Definition at line 3018 of file qsvghandler.cpp.

References QSvgUtils::LT_PT.

◆ parseTbreakNode()

bool parseTbreakNode ( QSvgNode * parent,
const QXmlStreamAttributes & ,
QSvgHandler *  )
static

Definition at line 3605 of file qsvghandler.cpp.

◆ parseTransform()

void parseTransform ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler *  )
static

Definition at line 1008 of file qsvghandler.cpp.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ parseTransformationMatrix()

QTransform parseTransformationMatrix ( QStringView value)
static

Definition at line 631 of file qsvghandler.cpp.

◆ parseViewBox()

std::optional< QRectF > parseViewBox ( QStringView str)
static

Definition at line 3001 of file qsvghandler.cpp.

◆ parseVisibility()

void parseVisibility ( QSvgNode * node,
const QSvgAttributes & attributes,
QSvgHandler *  )
static

Definition at line 1022 of file qsvghandler.cpp.

Referenced by parseStyle().

Here is the caller graph for this function:

◆ pathArc()

void pathArc ( QPainterPath & path,
qreal rx,
qreal ry,
qreal x_axis_rotation,
int large_arc_flag,
int sweep_flag,
qreal x,
qreal y,
qreal curx,
qreal cury )
static

Definition at line 1095 of file qsvghandler.cpp.

◆ pathArcSegment()

void pathArcSegment ( QPainterPath & path,
qreal xc,
qreal yc,
qreal th0,
qreal th1,
qreal rx,
qreal ry,
qreal xAxisRotation )
static

Definition at line 1036 of file qsvghandler.cpp.

◆ prefixMessage()

QByteArray prefixMessage ( const QByteArray & msg,
const QXmlStreamReader * r )
static

Definition at line 46 of file qsvghandler.cpp.

◆ Q_STATIC_ASSERT()

Q_STATIC_ASSERT ( sizeof(sizeTable)/sizeof(sizeTable[0]) = =FontSizeNone)

◆ qsvg_get_hex_rgb() [1/2]

bool qsvg_get_hex_rgb ( const char * name,
QRgb * rgb )

Definition at line 108 of file qsvghandler.cpp.

References qsvg_hex2int(), and qsvg_hex2int().

Here is the call graph for this function:

◆ qsvg_get_hex_rgb() [2/2]

bool qsvg_get_hex_rgb ( const QChar * str,
int len,
QRgb * rgb )

Definition at line 143 of file qsvghandler.cpp.

◆ qsvg_h2i()

int qsvg_h2i ( char hex,
bool * ok = nullptr )
inlinestatic

Definition at line 84 of file qsvghandler.cpp.

Referenced by qsvg_hex2int(), and qsvg_hex2int().

Here is the caller graph for this function:

◆ qsvg_hex2int() [1/2]

int qsvg_hex2int ( char s,
bool * ok = nullptr )
inlinestatic

Definition at line 102 of file qsvghandler.cpp.

References qsvg_h2i().

Referenced by qsvg_get_hex_rgb().

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

◆ qsvg_hex2int() [2/2]

int qsvg_hex2int ( const char * s,
bool * ok = nullptr )
inlinestatic

Definition at line 97 of file qsvghandler.cpp.

References qsvg_h2i().

Referenced by qsvg_get_hex_rgb().

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

◆ resolveColor()

bool resolveColor ( QStringView colorStr,
QColor & color,
QSvgHandler * handler )
static

returns true when successfully set the color. false signifies that the color should be inherited

Definition at line 451 of file qsvghandler.cpp.

◆ someId()

QString someId ( const QXmlStreamAttributes & attributes)
inlinestatic

Definition at line 158 of file qsvghandler.cpp.

◆ splitWithDelimiter()

QList< QStringView > splitWithDelimiter ( QStringView delimitedList)
static

Definition at line 76 of file qsvghandler.cpp.

◆ stringToList()

QStringList stringToList ( const QString & str)
inlinestatic

Definition at line 1573 of file qsvghandler.cpp.

◆ styleFromUrl()

QSvgStyleProperty * styleFromUrl ( QSvgNode * node,
QStringView url )
static

Definition at line 578 of file qsvghandler.cpp.

◆ svgToQtCompositionMode()

QPainter::CompositionMode svgToQtCompositionMode ( const QStringView op)
static

Definition at line 1647 of file qsvghandler.cpp.

Variable Documentation

◆ qt_inherit_text

QT_BEGIN_NAMESPACE const char * qt_inherit_text = "inherit"
static

Definition at line 43 of file qsvghandler.cpp.

◆ sizeTable

const qreal sizeTable
static
Initial value:
=
{ qreal(6.9), qreal(8.3), qreal(10.0), qreal(12.0), qreal(14.4), qreal(17.3), qreal(20.7) }
double qreal
Definition qtypes.h:205

Definition at line 876 of file qsvghandler.cpp.

◆ unfinishedElementsLimit

const int unfinishedElementsLimit = 2048
static

Definition at line 4090 of file qsvghandler.cpp.