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
qquickvectorimageincubator_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 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 QQUICKVECTORIMAGEINCUBATOR_P_P_H
5#define QQUICKVECTORIMAGEINCUBATOR_P_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
19#include <QtCore/private/qobject_p.h>
20#include <QtQml/private/qqmlrefcount_p.h>
21
22#include <memory>
23
24QT_BEGIN_NAMESPACE
25
26class QQuickVectorImageIncubatorPrivate: public QObjectPrivate
27{
28public:
29 class QmlComponentGuard {
30 public:
31 QmlComponentGuard() = default;
32 QmlComponentGuard(QmlComponentGuard &&) = default;
33 ~QmlComponentGuard();
34
35 QmlComponentGuard &operator=(QmlComponentGuard &&) = delete;
36
37 bool isNull() const
38 {
39 return m_component == nullptr && m_baseCompilationUnit == nullptr;
40 }
41
42 QQmlComponent *takeComponent();
43
44 QQmlComponent *component() const
45 {
46 return m_component.get();
47 }
48
49 void setComponent(QQmlComponent *component)
50 {
51 Q_ASSERT(m_component == nullptr);
52 m_component.reset(component);
53 }
54
55 private:
56 std::unique_ptr<QQmlComponent> m_component;
57 QQmlRefPointer<QV4::CompiledData::CompilationUnit> m_baseCompilationUnit;
58 };
59
60 static QQuickVectorImageIncubatorPrivate *get(QQuickVectorImageIncubator *incubator)
61 {
62 return static_cast<QQuickVectorImageIncubatorPrivate *>(QObjectPrivate::get(incubator));
63 }
64
65 QmlComponentGuard takeComponentGuard();
66
67 std::unique_ptr<QQuickVectorImageWorker> generatorWorker;
68 std::unique_ptr<QThread> workerThread;
69 QQmlContext *qmlContext = nullptr;
70 QQmlIncubator::Status status = QQmlIncubator::Null;
71 QmlComponentGuard componentGuard;
72};
73
74QT_END_NAMESPACE
75
76#endif // QQUICKVECTORIMAGEINCUBATOR_P_P_H
void createGenerator(const QQuickVectorImageSource &source, QQuickVectorImageGenerator::GeneratorFlags flags)
QQuickQmlGenerator * generator() const
void addPluginGenerator(QQuickVectorImagePluginGenerator *pluginGenerator)
Combined button and popup list for selecting options.
#define QQuickVectorImageFormatsPluginFactory_iid