QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
InternalTransition.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <functional>
6
13{
14 Q_OBJECT
15 Q_DISABLE_COPY(InternalTransition)
16
17public:
18 using Action = std::function<void()>;
19
24 template<typename Func>
25 InternalTransition(const typename QtPrivate::FunctionPointer<Func>::Object* sender,
26 Func signalFn, Action action = nullptr)
27 : QGCSignalTransition(sender, signalFn)
28 , _action(std::move(action))
29 {
30 setTransitionType(QAbstractTransition::InternalTransition);
31 // Internal transitions target the source state (stay in same state)
32 }
33
34protected:
35 void onTransition(QEvent* event) override;
36
37private:
38 Action _action;
39};
Transition that fires without exiting/re-entering the current state.
std::function< void()> Action
InternalTransition(const typename QtPrivate::FunctionPointer< Func >::Object *sender, Func signalFn, Action action=nullptr)
void onTransition(QEvent *event) override
Base class for signal-based transitions that need access to QGCStateMachine and Vehicle.