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
11class QGCAbstractTransition : public QAbstractTransition
12{
13 Q_OBJECT
14 Q_DISABLE_COPY(QGCAbstractTransition)
15
16public:
17 explicit QGCAbstractTransition(QState* sourceState = nullptr);
18 QGCAbstractTransition(QAbstractState* target, QState* sourceState = nullptr);
19
21 QGCStateMachine* machine() const;
22
24 Vehicle* vehicle() const;
25
26protected:
27 // Subclasses must implement these
28 bool eventTest(QEvent* event) override = 0;
29 void onTransition(QEvent* event) override;
30};
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.