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
qsvgcsshandler_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QSVGCSSHANDLER_P_H
7#define QSVGCSSHANDLER_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtSvg/private/qtsvgglobal_p.h>
21#include <QtSvg/private/qsvgcssanimation_p.h>
22#include <QtSvg/private/qsvgcssvalues_p.h>
23#include <QtSvg/private/qsvgcsseasing_p.h>
24#include <QtCore/qstringview.h>
25#include <QtGui/private/qcssparser_p.h>
26#include <QtCore/qxmlstream.h>
27
28QT_BEGIN_NAMESPACE
29
30class QSvgStyleSelector;
31class QSvgNode;
32class Q_SVG_EXPORT QSvgCssHandler {
33public:
34 QSvgCssHandler();
35 ~QSvgCssHandler();
36
37 QSvgCssAnimation *createAnimation(QStringView name);
38 static QSvgCssEasingPtr createEasing(QSvgCssValues::EasingFunction easingFunction,
39 const QSvgCssValues::EasingValues &values = {});
40
41 void collectAnimations(const QCss::StyleSheet &sheet);
42
43 void parseStyleSheet(const QStringView str);
44 static QString parseDecltoString(const QCss::Declaration &decl);
45 void parseCSStoXMLAttrs(const QList<QCss::Declaration> &declarations, QXmlStreamAttributes &attributes) const;
46 void parseCSStoXMLAttrs(const QString &css, QXmlStreamAttributes &attributes) const;
47
48 void styleLookup(QSvgNode *node, QXmlStreamAttributes &attributes) const;
49
50private:
51 static QSvgCssEasingPtr createEasingFromKeyword(QSvgCssValues::EasingFunction easingFunction);
52 static QSvgCssEasingPtr createStepsEasing(const QSvgCssValues::StepValues &values);
53
54private:
55 QHash<QString, QCss::AnimationRule> m_animations;
56 QSvgStyleSelector *m_selector = nullptr;
57};
58
59
60QT_END_NAMESPACE
61
62#endif // QSVGCSSHANDLER_P_H
Combined button and popup list for selecting options.
bool fillTransformProperty(const QList< CssKeyFrameValue > &keyFrames, QSvgAnimatedPropertyTransform *prop)
bool fillOffsetDistanceProperty(const QList< CssKeyFrameValue > &keyFrames, QSvgAnimatedPropertyFloat *prop)
bool fillOpacityProperty(const QList< CssKeyFrameValue > &keyFrames, QSvgAnimatedPropertyFloat *prop)
bool fillPropertyEasing(const QList< CssKeyFrameValue > &keyFrames, QSvgAbstractAnimatedProperty *prop)
bool fillColorProperty(const QList< CssKeyFrameValue > &keyFrames, QSvgAnimatedPropertyColor *prop)
bool validateTransform(QList< QList< QSvgAnimatedPropertyTransform::TransformComponent > > &keyFrameComponents)