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 TIMEOUTTRANSITION_H
5#define TIMEOUTTRANSITION_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
20#include <QtStateMachine/QSignalTransition>
21#include <QtQml/QQmlParserStatus>
22#include <QtQml/qqml.h>
23#include <QtCore/private/qproperty_p.h>
24
25QT_BEGIN_NAMESPACE
26class QTimer;
27
28class Q_STATEMACHINEQML_PRIVATE_EXPORT TimeoutTransition : public QSignalTransition, public QQmlParserStatus
29{
30 Q_OBJECT
31 Q_PROPERTY(int timeout READ timeout WRITE setTimeout BINDABLE bindableTimeout)
32 Q_INTERFACES(QQmlParserStatus)
33 QML_ELEMENT
34 QML_ADDED_IN_VERSION(1, 0)
35
36public:
37 TimeoutTransition(QState *parent = nullptr);
38 ~TimeoutTransition();
39
40 int timeout() const;
41 void setTimeout(int timeout);
42 QBindable<int> bindableTimeout();
43
44 void classBegin() override {}
45 void componentComplete() override;
46
47private:
48 QTimer *m_timer;
49};
50
51QT_END_NAMESPACE
52
53#endif
54

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