52 QSvgHandler(QIODevice *device, QtSvg::Options options = {},
53 QtSvg::AnimatorType type = QtSvg::AnimatorType::Automatic);
54 QSvgHandler(
const QByteArray &data, QtSvg::Options options = {},
55 QtSvg::AnimatorType type = QtSvg::AnimatorType::Automatic);
56 QSvgHandler(QXmlStreamReader *
const data, QtSvg::Options options = {},
57 QtSvg::AnimatorType type = QtSvg::AnimatorType::Automatic);
60 QIODevice *device()
const;
61 QSvgDocument *document()
const;
63 [[nodiscard]] std::unique_ptr<QSvgDocument> takeDocument();
65 inline bool ok()
const {
66 return document() != 0 && !xml->hasError();
69 inline QString errorString()
const {
return xml->errorString(); }
70 inline int lineNumber()
const {
return xml->lineNumber(); }
72 void setDefaultCoordinateSystem(QGuiSvg::LengthType type);
73 QGuiSvg::LengthType defaultCoordinateSystem()
const;
75 void pushColor(
const QColor &color);
78 QColor currentColor()
const;
80 void pushUnresolvedStyle(QSvgStyleProperty *prop);
82 void setCurrentSvgFontFamily(QStringView family);
84#ifndef QT_NO_CSSPARSER
85 QSvgCssHandler &cssHandler();
88 void setAnimPeriod(
int start,
int end);
89 int animationDuration()
const;
91 inline QPen defaultPen()
const
92 {
return m_defaultPen; }
94 QtSvg::Options options()
const;
95 QtSvg::AnimatorType animatorType()
const;
96 bool trustedSourceMode()
const;
99 bool startElement(
const QString localName,
const QXmlStreamAttributes &attributes);
100 bool endElement(
const QStringView localName);
101 bool characters(
const QStringView str);
102 bool processingInstruction(
const QStringView target,
const QStringView data);
108 std::unique_ptr<QSvgDocument> m_doc;
109 QStack<QSvgNode *> m_nodes;
114 QList<QSvgNode *> m_toBeResolved;
115 QList<QSvgStyleProperty *> m_unresolvedStyles;
124 QStack<CurrentNode> m_skipNodes;
127
128
129
130 QStack<QSvgText::WhitespaceMode> m_whitespaceMode;
139 return !font || fontFamily.isEmpty();
149 SvgFontData m_currentSvgFontData;
150 QSvgPaintServerSharedPtr m_paintServer;
152 QGuiSvg::LengthType m_defaultCoords;
154 QStack<QColor> m_colorStack;
155 QStack<
int> m_colorTagCount;
159 QXmlStreamReader *
const xml;
160#ifndef QT_NO_CSSPARSER
161 QSvgCssHandler m_cssHandler;
164 void resolvePaintServers();
169
170
171
172 const bool m_ownsReader;
174 const QtSvg::Options m_options;
175 const QtSvg::AnimatorType m_animatorType;