QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
NamedEventTransition.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <QtCore/QString>
7#include <functional>
8
13{
14 Q_OBJECT
15 Q_DISABLE_COPY(NamedEventTransition)
16
17public:
18 using NamedGuard = std::function<bool(const QGCStateMachineEvent*)>;
19
24 NamedEventTransition(const QString& eventName, QAbstractState* target, QState* sourceState = nullptr);
25
31 NamedEventTransition(const QString& eventName, QAbstractState* target, NamedGuard guard, QState* sourceState = nullptr);
32
33 QString eventName() const { return _eventName; }
34
35protected:
36 bool eventTest(QEvent* event) override;
37
38private:
39 QString _eventName;
40 NamedGuard _namedGuard;
41};
std::function< bool(const QGCStateMachineEvent *)> NamedGuard
bool eventTest(QEvent *event) override
Base class for custom transitions that need access to QGCStateMachine and Vehicle.
Custom event for QGCStateMachine delayed/scheduled events.