forked from qt-creator/qt-creator
Import from: https://github.com/qt/qtscxml/tree/dev/examples/scxml/trafficlight-common and implement it in terms of TaskTree. The recipe() corresponds to trafficlight.scxml file and implements the business logic. Used components: TimeoutTask and BarrierTask. Change-Id: Ifc08b947388abed8cfc85ba082aaa0b18da0a1d7 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
27 lines
540 B
C++
27 lines
540 B
C++
// Copyright (C) 2024 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
|
|
#include "glueinterface.h"
|
|
#include "recipe.h"
|
|
#include "trafficlight.h"
|
|
|
|
#include <tasking/tasktree.h>
|
|
|
|
#include <QtWidgets/qapplication.h>
|
|
|
|
using namespace Tasking;
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
QApplication app(argc, argv);
|
|
|
|
GlueInterface iface;
|
|
TaskTree taskTree(recipe(&iface));
|
|
TrafficLight widget(&iface);
|
|
|
|
widget.show();
|
|
taskTree.start();
|
|
|
|
return app.exec();
|
|
}
|