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
qquickgeneratoranimationprovider_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 QQUICKGENERATORANIMATIONPROVIDER_P_H
5#define QQUICKGENERATORANIMATIONPROVIDER_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
20
21#include <QtCore/qstring.h>
22
23#include <functional>
24
26
27class QQuickAbstractAnimation;
28class QQuickItem;
29
30class Q_QUICKVECTORIMAGEGENERATOR_EXPORT QQuickGeneratorAnimationProvider
31{
32public:
33 virtual ~QQuickGeneratorAnimationProvider();
34
35 virtual QQuickAbstractAnimation *enterTimelineScope(QQuickItem *item,
36 const StructureNodeInfo &info) = 0;
37 virtual void enterTimelineScope(const QString &scopeId, const QString &referenceId) = 0;
38 virtual void exitTimelineScope() = 0;
39
40 virtual void bindProperty(QObject *target, const QByteArray &propertyName,
41 const QQuickAnimatedProperty &property) = 0;
42
43 virtual QQuickItem *createCustomItem(const QString &type) = 0;
44
45 // Set by the generator. Calls which have to be made on the GUI thread (such as completing
46 // QML objects or starting animations) must be passed to deferToGuiThread().
47 using DeferFunction = std::function<void(std::function<void()>)>;
48 void setDeferFunction(DeferFunction deferFunction) { m_deferFunction = std::move(deferFunction); }
49
50protected:
51 void deferToGuiThread(std::function<void()> call)
52 {
53 if (m_deferFunction)
54 m_deferFunction(std::move(call));
55 else
56 call();
57 }
58
59private:
60 DeferFunction m_deferFunction;
61};
62
63QT_END_NAMESPACE
64
65#endif // QQUICKGENERATORANIMATIONPROVIDER_P_H
Combined button and popup list for selecting options.
static StrokeStyle fromPen(const QPen &p)