1// Copyright (C) 2016 Ford Motor Company
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 QQMLFINALSTATE_H
5#define QQMLFINALSTATE_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 "qstatemachineqmlglobals_p.h"
19#include "childrenprivate_p.h"
20#include "statemachine_p.h"
21
22#include <QtCore/private/qproperty_p.h>
23#include <QtStateMachine/QFinalState>
24#include <QtQml/QQmlListProperty>
25#include <QtQml/qqml.h>
26
27
28QT_BEGIN_NAMESPACE
29
30class Q_STATEMACHINEQML_PRIVATE_EXPORT FinalState : public QFinalState
31{
32 Q_OBJECT
33 Q_PROPERTY(QQmlListProperty<QObject> children READ children
34 NOTIFY childrenChanged BINDABLE bindableChildren)
35 Q_CLASSINFO("DefaultProperty", "children")
36 QML_ELEMENT
37 QML_ADDED_IN_VERSION(1, 0)
38
39public:
40 explicit FinalState(QState *parent = 0);
41
42 QQmlListProperty<QObject> children();
43 QBindable<QQmlListProperty<QObject>> bindableChildren() const;
44
45Q_SIGNALS:
46 void childrenChanged();
47
48private:
49 // See the childrenActualCalculation for the mutable explanation
50 mutable ChildrenPrivate<FinalState, ChildrenMode::State> m_children;
51 friend ChildrenPrivate<FinalState, ChildrenMode::State>;
52 void childrenContentChanged();
53 QQmlListProperty<QObject> childrenActualCalculation() const;
54 Q_OBJECT_COMPUTED_PROPERTY(FinalState, QQmlListProperty<QObject>, m_childrenComputedProperty,
55 &FinalState::childrenActualCalculation);
56};
57
58QT_END_NAMESPACE
59#endif
60

source code of qtscxml/src/statemachineqml/finalstate_p.h