QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCAbstractTransition.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtStateMachine/QAbstractTransition>
4#include <QtCore/QString>
5
7class Vehicle;
8
10class QGCAbstractTransition : public QAbstractTransition
11{
12 Q_OBJECT
13 Q_DISABLE_COPY(QGCAbstractTransition)
14
15public:
16 explicit QGCAbstractTransition(QState* sourceState = nullptr);
17 QGCAbstractTransition(QAbstractState* target, QState* sourceState = nullptr);
18
20 QGCStateMachine* machine() const;
21
23 Vehicle* vehicle() const;
24
25protected:
26 // Subclasses must implement these
27 bool eventTest(QEvent* event) override = 0;
28 void onTransition(QEvent* event) override;
29};
Base class for custom transitions that need access to QGCStateMachine and Vehicle.
void onTransition(QEvent *event) override
QGCStateMachine * machine() const
Get the QGCStateMachine this transition belongs to.
Vehicle * vehicle() const
Get the Vehicle associated with the state machine.
bool eventTest(QEvent *event) override=0
QGroundControl specific state machine with enhanced error handling.