1// Copyright (C) 2017 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 QQUICKIMAGINESTYLE_P_H
5#define QQUICKIMAGINESTYLE_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 <QtCore/qvariant.h>
19#include <QtQml/qqml.h>
20#include <QtQuickControls2/qquickattachedpropertypropagator.h>
21
22QT_BEGIN_NAMESPACE
23
24class QQuickImagineStyle : public QQuickAttachedPropertyPropagator
25{
26 Q_OBJECT
27 Q_PROPERTY(QString path READ path WRITE setPath RESET resetPath NOTIFY pathChanged FINAL)
28 Q_PROPERTY(QUrl url READ url NOTIFY pathChanged FINAL)
29 QML_NAMED_ELEMENT(Imagine)
30 QML_ATTACHED(QQuickImagineStyle)
31 QML_UNCREATABLE("")
32 QML_ADDED_IN_VERSION(2, 3)
33
34public:
35 explicit QQuickImagineStyle(QObject *parent = nullptr);
36
37 static QQuickImagineStyle *qmlAttachedProperties(QObject *object);
38
39 QString path() const;
40 void setPath(const QString &path);
41 void inheritPath(const QString &path);
42 void propagatePath();
43 void resetPath();
44
45 QUrl url() const;
46
47Q_SIGNALS:
48 void pathChanged();
49
50protected:
51 void attachedParentChange(QQuickAttachedPropertyPropagator *newParent, QQuickAttachedPropertyPropagator *oldParent) override;
52
53private:
54 void init();
55
56 bool m_explicitPath = false;
57 QString m_path;
58};
59
60QT_END_NAMESPACE
61
62#endif // QQUICKIMAGINESTYLE_P_H
63

source code of qtdeclarative/src/quickcontrols/imagine/qquickimaginestyle_p.h