blob: 49d75498a71db5c614e538588d7950922e3f6a87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QScxmlStateMachine>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
/* Register QScxmlStateMachine as TrafficLightStateMachine. This is required to have a type
* for the state machine and allows full code completion in the static case, since we
* share the QML code. */
qmlRegisterUncreatableType<QScxmlStateMachine>("TrafficLightStateMachine",
1, 0,
"TrafficLightStateMachine",
QLatin1String("TrafficLightStateMachine is not creatable."));
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:///trafficlight-qml-dynamic.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
|