Files
qt-creator/tests/manual/tasking/trafficlight/glueinterface.h
Jarek Kobus 7c0b831391 TaskTree: Implement TrafficLight example
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>
2024-01-11 11:36:06 +00:00

33 lines
746 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
#ifndef GLUEINTERFACE_H
#define GLUEINTERFACE_H
#include <QObject>
class GlueInterface final : public QObject
{
Q_OBJECT
public:
// business logic -> GUI
void setRed(bool on) { emit redChanged(on); }
void setYellow(bool on) { emit yellowChanged(on); }
void setGreen(bool on) { emit greenChanged(on); }
// GUI -> business logic
void smash() { emit smashed(); }
void repair() { emit repaired(); }
signals:
void redChanged(bool on);
void yellowChanged(bool on);
void greenChanged(bool on);
void smashed();
void repaired();
};
#endif // GLUEINTERFACE_H