QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCState.cc
Go to the documentation of this file.
1#include "QGCStateMachine.h"
3
4QGC_LOGGING_CATEGORY(QGCStateMachineLog, "Utilities.QGCStateMachine")
5
6QGCState::QGCState(const QString& stateName, QState* parentState)
7 : QGCAbstractState(stateName, parentState)
8{
9}
10
11void QGCState::setLocalErrorState(QAbstractState* errorState)
12{
13 _localErrorState = errorState;
14 if (errorState) {
15 addTransition(this, &QGCState::error, errorState);
16 qCDebug(QGCStateMachineLog) << stateName() << "set local error state";
17 }
18}
19
20void QGCState::setProperty(QObject* object, const char* name, const QVariant& value)
21{
22 assignProperty(object, name, value);
23}
24
25void QGCState::setEnabled(QObject* object, bool enabled)
26{
27 assignProperty(object, "enabled", enabled);
28}
29
30void QGCState::setVisible(QObject* object, bool visible)
31{
32 assignProperty(object, "visible", visible);
33}
#define QGC_LOGGING_CATEGORY(name, categoryStr)
QString stateName() const
void setEnabled(QObject *object, bool enabled)
Convenience overload for setting enabled state on widgets/controls.
Definition QGCState.cc:25
void setVisible(QObject *object, bool visible)
Convenience overload for setting visible state on widgets/controls.
Definition QGCState.cc:30
void setProperty(QObject *object, const char *name, const QVariant &value)
Definition QGCState.cc:20
void setLocalErrorState(QAbstractState *errorState)
Definition QGCState.cc:11