QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCApplication Class Reference

The main application and management class. More...

#include <QGCApplication.h>

+ Inheritance diagram for QGCApplication:
+ Collaboration diagram for QGCApplication:

Public Slots

void qmlAttemptWindowClose ()
 
QLocale getCurrentLanguage () const
 Get current language.
 
void showCriticalVehicleMessage (const QString &message)
 Show non-modal vehicle message to the user.
 
void showAppMessage (const QString &message, const QString &title=QString())
 Show modal application message to the user.
 
void showRebootAppMessage (const QString &message, const QString &title=QString())
 
void showRebootVehicleMessage (const QString &message, const QString &title=QString())
 Same as showRebootAppMessage() but the dialog also includes a button which reboots the active vehicle.
 
QGCImageProviderqgcImageProvider ()
 

Signals

void languageChanged (const QLocale &locale)
 

Public Member Functions

 QGCApplication (int &argc, char *argv[], const QGCCommandLineParser::CommandLineParseResult &args)
 
 ~QGCApplication ()
 
bool runningUnitTests () const
 
bool simpleBootTest () const
 
bool bootTestPassed () const
 
bool logOutput () const
 Returns true if Qt debug output should be logged to a file.
 
void reportMissingParameter (int componentId, const QString &name)
 
bool fakeMobile () const
 
void setLanguage ()
 
QQuickWindow * mainRootWindow ()
 
uint64_t msecsSinceBoot () const
 
void addCompressedSignal (const QMetaMethod &method)
 Registers the signal such that only the last duplicate signal added is left in the queue.
 
void removeCompressedSignal (const QMetaMethod &method)
 
bool event (QEvent *e) final
 
void init ()
 Perform initialize which is common to both normal application running and unit tests.
 
void shutdown ()
 
QQmlApplicationEngine * qmlAppEngine () const
 Although public, these methods are internal and should only be called by UnitTest code.
 
void setQmlAppEngine (QQmlApplicationEngine *engine)
 
void resetRebootMessageDebounce ()
 

Static Public Member Functions

static QString cachedParameterMetaDataFile ()
 
static QString cachedAirframeMetaDataFile ()
 

Friends

class UnitTest
 Unit Test have access to creating and destroying singletons.
 

Detailed Description

The main application and management class.

Definition at line 39 of file QGCApplication.h.

Constructor & Destructor Documentation

◆ QGCApplication()

◆ ~QGCApplication()

QGCApplication::~QGCApplication ( )

Definition at line 226 of file QGCApplication.cc.

Member Function Documentation

◆ addCompressedSignal()

void QGCApplication::addCompressedSignal ( const QMetaMethod &  method)

Registers the signal such that only the last duplicate signal added is left in the queue.

Definition at line 665 of file QGCApplication.cc.

◆ bootTestPassed()

bool QGCApplication::bootTestPassed ( ) const
inline

Definition at line 51 of file QGCApplication.h.

Referenced by main().

◆ cachedAirframeMetaDataFile()

QString QGCApplication::cachedAirframeMetaDataFile ( )
static

Definition at line 611 of file QGCApplication.cc.

◆ cachedParameterMetaDataFile()

QString QGCApplication::cachedParameterMetaDataFile ( )
static

Definition at line 604 of file QGCApplication.cc.

◆ event()

QT_WARNING_POP bool QGCApplication::event ( QEvent *  e)
final

Definition at line 730 of file QGCApplication.cc.

◆ fakeMobile()

bool QGCApplication::fakeMobile ( ) const
inline
Returns
true: Fake ui into showing mobile interface

Definition at line 61 of file QGCApplication.h.

◆ getCurrentLanguage

QLocale QGCApplication::getCurrentLanguage ( ) const
inlineslot

Get current language.

Definition at line 103 of file QGCApplication.h.

◆ init()

void QGCApplication::init ( )

Perform initialize which is common to both normal application running and unit tests.

Definition at line 228 of file QGCApplication.cc.

References LogManager::init(), SettingsManager::init(), LogManager::instance(), SettingsManager::instance(), and SettingsManager::mavlinkSettings().

Referenced by main().

◆ languageChanged

void QGCApplication::languageChanged ( const QLocale &  locale)
signal

◆ logOutput()

bool QGCApplication::logOutput ( ) const
inline

Returns true if Qt debug output should be logged to a file.

Definition at line 54 of file QGCApplication.h.

◆ mainRootWindow()

QQuickWindow * QGCApplication::mainRootWindow ( )

Definition at line 520 of file QGCApplication.cc.

◆ msecsSinceBoot()

uint64_t QGCApplication::msecsSinceBoot ( ) const
inline

Definition at line 65 of file QGCApplication.h.

◆ qgcImageProvider

QGCImageProvider * QGCApplication::qgcImageProvider ( )
slot

Definition at line 757 of file QGCApplication.cc.

◆ qmlAppEngine()

QQmlApplicationEngine * QGCApplication::qmlAppEngine ( ) const
inline

Although public, these methods are internal and should only be called by UnitTest code.

Definition at line 83 of file QGCApplication.h.

◆ qmlAttemptWindowClose

void QGCApplication::qmlAttemptWindowClose ( )
slot

Definition at line 529 of file QGCApplication.cc.

◆ removeCompressedSignal()

void QGCApplication::removeCompressedSignal ( const QMetaMethod &  method)

Definition at line 670 of file QGCApplication.cc.

◆ reportMissingParameter()

void QGCApplication::reportMissingParameter ( int  componentId,
const QString &  name 
)

Used to report a missing Parameter. Warning will be displayed to user. Method may be called multiple times.

Definition at line 368 of file QGCApplication.cc.

◆ resetRebootMessageDebounce()

void QGCApplication::resetRebootMessageDebounce ( )
inline

showRebootAppMessage() debounces repeat messages (2 min). Tests reset the debounce per-test so each one deterministically sees its own message.

Definition at line 94 of file QGCApplication.h.

◆ runningUnitTests()

bool QGCApplication::runningUnitTests ( ) const
inline

◆ setLanguage()

void QGCApplication::setLanguage ( )

Definition at line 174 of file QGCApplication.cc.

References languageChanged(), and JsonParsing::translator().

◆ setQmlAppEngine()

void QGCApplication::setQmlAppEngine ( QQmlApplicationEngine *  engine)
inline

UI test harnesses create their own QML engine; registering it here lets app-level messaging (showAppMessage) reach the test's MainWindow. Pass nullptr on teardown.

Definition at line 86 of file QGCApplication.h.

◆ showAppMessage

void QGCApplication::showAppMessage ( const QString &  message,
const QString &  title = QString() 
)
slot

Show modal application message to the user.

Definition at line 431 of file QGCApplication.cc.

References runningUnitTests().

Referenced by showRebootAppMessage().

◆ showCriticalVehicleMessage

void QGCApplication::showCriticalVehicleMessage ( const QString &  message)
slot

Show non-modal vehicle message to the user.

Definition at line 409 of file QGCApplication.cc.

References runningUnitTests().

◆ showRebootAppMessage

void QGCApplication::showRebootAppMessage ( const QString &  message,
const QString &  title = QString() 
)
slot

Show modal application message to the user about the need for a reboot. Multiple messages will be supressed if they occur one after the other.

Definition at line 470 of file QGCApplication.cc.

References showAppMessage().

◆ showRebootVehicleMessage

void QGCApplication::showRebootVehicleMessage ( const QString &  message,
const QString &  title = QString() 
)
slot

Same as showRebootAppMessage() but the dialog also includes a button which reboots the active vehicle.

Definition at line 479 of file QGCApplication.cc.

References runningUnitTests().

◆ shutdown()

◆ simpleBootTest()

bool QGCApplication::simpleBootTest ( ) const
inline

Definition at line 50 of file QGCApplication.h.

Friends And Related Symbol Documentation

◆ UnitTest

friend class UnitTest
friend

Unit Test have access to creating and destroying singletons.

Definition at line 44 of file QGCApplication.h.


The documentation for this class was generated from the following files: