1// Copyright (C) 2021 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 QQUICKDEFAULTBUSYINDICATOR_P_H
5#define QQUICKDEFAULTBUSYINDICATOR_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 <QtQuick/qquickitem.h>
19#include <QtGui/qcolor.h>
20#include <QtCore/private/qglobal_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QQuickBasicBusyIndicator : public QQuickItem
25{
26 Q_OBJECT
27 Q_PROPERTY(QColor pen READ pen WRITE setPen FINAL)
28 Q_PROPERTY(QColor fill READ fill WRITE setFill FINAL)
29 Q_PROPERTY(bool running READ isRunning WRITE setRunning)
30 QML_NAMED_ELEMENT(BusyIndicatorImpl)
31 QML_ADDED_IN_VERSION(2, 0)
32
33public:
34 explicit QQuickBasicBusyIndicator(QQuickItem *parent = nullptr);
35
36 QColor pen() const;
37 void setPen(const QColor &pen);
38
39 QColor fill() const;
40 void setFill(const QColor &fill);
41
42 bool isRunning() const;
43 void setRunning(bool running);
44
45 int elapsed() const;
46
47protected:
48 void itemChange(ItemChange change, const ItemChangeData &data) override;
49 QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override;
50
51private:
52 int m_elapsed = 0;
53 QColor m_pen;
54 QColor m_fill;
55};
56
57QT_END_NAMESPACE
58
59QML_DECLARE_TYPE(QQuickBasicBusyIndicator)
60
61#endif // QQUICKDEFAULTBUSYINDICATOR_P_H
62

source code of qtdeclarative/src/quickcontrols/basic/impl/qquickbasicbusyindicator_p.h