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 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 void parseCSStoXMLAttrs(const QList<QCss::Declaration> &declarations, QXmlStreamAttributes &attributes) const;
45 void parseCSStoXMLAttrs(const QString &css, QXmlStreamAttributes &attributes) const;
46
47 void styleLookup(QSvgNode *node, QXmlStreamAttributes &attributes) const;
48
49private:
50 QSvgCssEasingPtr createEasingFromKeyword(QSvgCssValues::EasingFunction easingFunction);
51 QSvgCssEasingPtr createStepsEasing(const QSvgCssValues::StepValues &values);
52
53private:
54 QHash<QString, QCss::AnimationRule> m_animations;
55 QSvgStyleSelector *m_selector = nullptr;
56};
57
58
59QT_END_NAMESPACE
60
61#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 fillColorProperty(const QList< CssKeyFrameValue > &keyFrames, QSvgAnimatedPropertyColor *prop)
bool validateTransform(QList< QList< QSvgAnimatedPropertyTransform::TransformComponent > > &keyFrameComponents)