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

Provided by KDAB

Privacy Policy
Learn Advanced QML with KDAB
Find out more

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