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
qquickqmlgenerator_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 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
4#ifndef QQUICKQMLGENERATOR_P_H
5#define QQUICKQMLGENERATOR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qquickgenerator_p.h"
19
20#include <QtCore/qtextstream.h>
21
23
24class GeneratorStream;
25
26class Q_QUICKVECTORIMAGEGENERATOR_EXPORT QQuickQmlGenerator : public QQuickGenerator
27{
28public:
29 QQuickQmlGenerator(const QString fileName, QQuickVectorImageGenerator::GeneratorFlags flags, const QString &outFileName);
31
32 void setShapeTypeName(const QString &name);
33 QString shapeTypeName() const;
34
35 void setCommentString(const QString commentString);
36 QString commentString() const;
37
38 void setRetainFilePaths(bool retainFilePaths)
39 {
40 m_retainFilePaths = retainFilePaths;
41 }
42
43 bool retainFilePaths() const
44 {
45 return m_retainFilePaths;
46 }
47
48 void setAssetFileDirectory(const QString &assetFileDirectory)
49 {
50 m_assetFileDirectory = assetFileDirectory;
51 }
52
54 {
55 return m_assetFileDirectory;
56 }
57
58 void setAssetFilePrefix(const QString &assetFilePrefix)
59 {
60 m_assetFilePrefix = assetFilePrefix;
61 }
62
64 {
65 return m_assetFilePrefix;
66 }
67
68protected:
69 void generateNodeBase(const NodeInfo &info) override;
70 bool generateDefsNode(const NodeInfo &info) override;
71 void generateImageNode(const ImageNodeInfo &info) override;
72 void generatePath(const PathNodeInfo &info) override;
73 void generateNode(const NodeInfo &info) override;
74 void generateTextNode(const TextNodeInfo &info) override;
75 void generateUseNode(const UseNodeInfo &info) override;
76 bool generateStructureNode(const StructureNodeInfo &info) override;
77 bool generateRootNode(const StructureNodeInfo &info) override;
78 void outputShapePath(const PathNodeInfo &info, const QPainterPath *path, const QQuadPath *quadPath, QQuickVectorImageGenerator::PathSelector pathSelector, const QRectF &boundingRect) override;
79
80private:
81 void generateGradient(const QGradient *grad, const QRectF &boundingRect);
82 QString indent();
84 const char *shapeName() const;
85
86private:
87 int m_indentLevel = 0;
88 QTextStream *m_stream;
90 QString outputFileName;
91 bool m_inShapeItem = false;
92 QByteArray m_shapeTypeName;
93 QString m_commentString;
94 bool m_retainFilePaths = false;
95 QString m_assetFileDirectory;
96 QString m_assetFilePrefix;
97};
98
100
101#endif // QQUICKQMLGENERATOR_P_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtGui
Definition qbrush.h:135
\inmodule QtGui
void setAssetFilePrefix(const QString &assetFilePrefix)
QString assetFileDirectory() const
void setRetainFilePaths(bool retainFilePaths)
void setAssetFileDirectory(const QString &assetFileDirectory)
QString assetFilePrefix() const
\inmodule QtCore\reentrant
Definition qrect.h:484
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Combined button and popup list for selecting options.
EGLStreamKHR stream
GLbitfield flags
GLuint name
GLsizei const GLchar *const * path
GLuint64EXT * result
[6]
static const QRectF boundingRect(const QPointF *points, int pointCount)
QHostInfo info
[0]