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
11{
12 Q_OBJECT
13 Q_DISABLE_COPY(InternalTransition)
14
15public:
16 using Action = std::function<void()>;
17
22 template<typename Func>
23 InternalTransition(const typename QtPrivate::FunctionPointer<Func>::Object* sender,
24 Func signalFn, Action action = nullptr)
25 : QGCSignalTransition(sender, signalFn)
26 , _action(std::move(action))
27 {
28 setTransitionType(QAbstractTransition::InternalTransition);
29 // Internal transitions target the source state (stay in same state)
30 }
31
32protected:
33 void onTransition(QEvent* event) override;
34
35private:
36 Action _action;
37};
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.