Commit 4f080b9d authored by Don Gagne's avatar Don Gagne

Mobile runs Native QML

parent 52594677
...@@ -37,7 +37,6 @@ linux { ...@@ -37,7 +37,6 @@ linux {
DEFINES += __android__ DEFINES += __android__
DEFINES += __STDC_LIMIT_MACROS DEFINES += __STDC_LIMIT_MACROS
target.path = $$DESTDIR target.path = $$DESTDIR
warning("Android build is experimental and not fully functional")
} else { } else {
error("Unsuported Linux toolchain, only GCC 32- or 64-bit is supported") error("Unsuported Linux toolchain, only GCC 32- or 64-bit is supported")
} }
......
...@@ -278,7 +278,6 @@ HEADERS += \ ...@@ -278,7 +278,6 @@ HEADERS += \
src/uas/UAS.h \ src/uas/UAS.h \
src/uas/UASInterface.h \ src/uas/UASInterface.h \
src/uas/UASMessageHandler.h \ src/uas/UASMessageHandler.h \
src/ui/MainWindow.h \
src/ui/toolbar/MainToolBarController.h \ src/ui/toolbar/MainToolBarController.h \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.h \ src/AutoPilotPlugins/PX4/PX4AirframeLoader.h \
src/QmlControls/QGCImageProvider.h \ src/QmlControls/QGCImageProvider.h \
...@@ -327,6 +326,7 @@ HEADERS += \ ...@@ -327,6 +326,7 @@ HEADERS += \
src/ui/linechart/Scrollbar.h \ src/ui/linechart/Scrollbar.h \
src/ui/linechart/ScrollZoomer.h \ src/ui/linechart/ScrollZoomer.h \
src/ui/LogReplayLinkConfigurationWidget.h \ src/ui/LogReplayLinkConfigurationWidget.h \
src/ui/MainWindow.h \
src/ui/MAVLinkDecoder.h \ src/ui/MAVLinkDecoder.h \
src/ui/MAVLinkSettingsWidget.h \ src/ui/MAVLinkSettingsWidget.h \
src/ui/MultiVehicleDockWidget.h \ src/ui/MultiVehicleDockWidget.h \
...@@ -400,7 +400,6 @@ SOURCES += \ ...@@ -400,7 +400,6 @@ SOURCES += \
src/QmlControls/QmlObjectListModel.cc \ src/QmlControls/QmlObjectListModel.cc \
src/uas/UAS.cc \ src/uas/UAS.cc \
src/uas/UASMessageHandler.cc \ src/uas/UASMessageHandler.cc \
src/ui/MainWindow.cc \
src/ui/toolbar/MainToolBarController.cc \ src/ui/toolbar/MainToolBarController.cc \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc \ src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc \
src/QmlControls/QGCImageProvider.cc \ src/QmlControls/QGCImageProvider.cc \
...@@ -453,6 +452,7 @@ SOURCES += \ ...@@ -453,6 +452,7 @@ SOURCES += \
src/ui/linechart/LinechartWidget.cc \ src/ui/linechart/LinechartWidget.cc \
src/ui/linechart/Scrollbar.cc \ src/ui/linechart/Scrollbar.cc \
src/ui/linechart/ScrollZoomer.cc \ src/ui/linechart/ScrollZoomer.cc \
src/ui/MainWindow.cc \
src/ui/MultiVehicleDockWidget.cc \ src/ui/MultiVehicleDockWidget.cc \
src/ui/QGCDataPlot2D.cc \ src/ui/QGCDataPlot2D.cc \
src/ui/QGCHilConfiguration.cc \ src/ui/QGCHilConfiguration.cc \
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
<file alias="JoystickConfig.qml">src/VehicleSetup/JoystickConfig.qml</file> <file alias="JoystickConfig.qml">src/VehicleSetup/JoystickConfig.qml</file>
<file alias="MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file> <file alias="MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file>
<file alias="MainWindow.qml">src/ui/MainWindow.qml</file> <file alias="MainWindowHybrid.qml">src/ui/MainWindowHybrid.qml</file>
<file alias="MainWindowInner.qml">src/ui/MainWindowInner.qml</file>
<file alias="MainWindowNative.qml">src/ui/MainWindowNative.qml</file>
<file alias="MainWindowLeftPanel.qml">src/ui/MainWindowLeftPanel.qml</file> <file alias="MainWindowLeftPanel.qml">src/ui/MainWindowLeftPanel.qml</file>
<file alias="MissionEditor.qml">src/MissionEditor/MissionEditor.qml</file> <file alias="MissionEditor.qml">src/MissionEditor/MissionEditor.qml</file>
<file alias="MissionEditorHelp.qml">src/MissionEditor/MissionEditorHelp.qml</file> <file alias="MissionEditorHelp.qml">src/MissionEditor/MissionEditorHelp.qml</file>
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "AutoPilotPlugin.h" #include "AutoPilotPlugin.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "MainWindow.h"
#include "ParameterLoader.h" #include "ParameterLoader.h"
#include "UAS.h" #include "UAS.h"
#include "FirmwarePlugin.h" #include "FirmwarePlugin.h"
...@@ -65,7 +64,7 @@ void AutoPilotPlugin::_parametersReadyChanged(bool parametersReady) ...@@ -65,7 +64,7 @@ void AutoPilotPlugin::_parametersReadyChanged(bool parametersReady)
qgcApp()->showMessage("One or more vehicle components require setup prior to flight."); qgcApp()->showMessage("One or more vehicle components require setup prior to flight.");
// Take the user to Vehicle Summary // Take the user to Vehicle Summary
MainWindow::instance()->showSetupView(); qgcApp()->showSetupView();
qgcApp()->processEvents(QEventLoop::ExcludeUserInputEvents); qgcApp()->processEvents(QEventLoop::ExcludeUserInputEvents);
} }
} }
......
...@@ -43,10 +43,8 @@ ...@@ -43,10 +43,8 @@
#include "QGC.h" #include "QGC.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "MainWindow.h"
#include "GAudioOutput.h" #include "GAudioOutput.h"
#include "CmdLineOptParser.h" #include "CmdLineOptParser.h"
#include "MainWindow.h"
#include "UDPLink.h" #include "UDPLink.h"
#include "LinkManager.h" #include "LinkManager.h"
#include "HomePositionManager.h" #include "HomePositionManager.h"
...@@ -101,6 +99,7 @@ ...@@ -101,6 +99,7 @@
#include "QGCMessageBox.h" #include "QGCMessageBox.h"
#include "FirmwareUpgradeController.h" #include "FirmwareUpgradeController.h"
#include "JoystickConfigController.h" #include "JoystickConfigController.h"
#include "MainWindow.h"
#endif #endif
#ifdef QGC_RTLAB_ENABLED #ifdef QGC_RTLAB_ENABLED
...@@ -154,7 +153,12 @@ static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*) ...@@ -154,7 +153,12 @@ static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*)
**/ **/
QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
#ifdef __mobile__
: QGuiApplication(argc, argv)
, _qmlAppEngine(NULL)
#else
: QApplication(argc, argv) : QApplication(argc, argv)
#endif
, _runningUnitTests(unitTesting) , _runningUnitTests(unitTesting)
#if defined (__mobile__) #if defined (__mobile__)
, _styleIsDark(false) , _styleIsDark(false)
...@@ -323,10 +327,12 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) ...@@ -323,10 +327,12 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
QGCApplication::~QGCApplication() QGCApplication::~QGCApplication()
{ {
#ifndef __mobile__
MainWindow* mainWindow = MainWindow::instance(); MainWindow* mainWindow = MainWindow::instance();
if (mainWindow) { if (mainWindow) {
delete mainWindow; delete mainWindow;
} }
#endif
shutdownVideoStreaming(); shutdownVideoStreaming();
delete _toolbox; delete _toolbox;
} }
...@@ -446,18 +452,23 @@ bool QGCApplication::_initForNormalAppBoot(void) ...@@ -446,18 +452,23 @@ bool QGCApplication::_initForNormalAppBoot(void)
// Exit main application when last window is closed // Exit main application when last window is closed
connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit())); connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit()));
#ifdef __mobile__
_qmlAppEngine = new QQmlApplicationEngine(this);
_qmlAppEngine->addImportPath("qrc:/qml");
_qmlAppEngine->rootContext()->setContextProperty("multiVehicleManager", toolbox()->multiVehicleManager());
_qmlAppEngine->rootContext()->setContextProperty("joystickManager", toolbox()->joystickManager());
_qmlAppEngine->load(QUrl(QStringLiteral("qrc:/qml/MainWindowNative.qml")));
#else
// Start the user interface // Start the user interface
MainWindow* mainWindow = MainWindow::_create(); MainWindow* mainWindow = MainWindow::_create();
Q_CHECK_PTR(mainWindow); Q_CHECK_PTR(mainWindow);
#ifndef __mobile__
// If we made it this far and we still don't have a location. Either the specfied location was invalid // If we made it this far and we still don't have a location. Either the specfied location was invalid
// or we coudn't create a default location. Either way, we need to let the user know and prompt for a new // or we coudn't create a default location. Either way, we need to let the user know and prompt for a new
/// settings. /// settings.
QString savedFilesLocation = settings.value(_savedFilesLocationKey).toString(); QString savedFilesLocation = settings.value(_savedFilesLocationKey).toString();
if (savedFilesLocation.isEmpty()) { if (savedFilesLocation.isEmpty()) {
showMessage("The location to save files to is invalid, or cannot be written to. Please provide a new one."); showMessage("The location to save files to is invalid, or cannot be written to. Please provide a new one.");
mainWindow->showSettings();
} }
// Now that main window is up check for lost log files // Now that main window is up check for lost log files
...@@ -653,12 +664,10 @@ void QGCApplication::setStyle(bool styleIsDark) ...@@ -653,12 +664,10 @@ void QGCApplication::setStyle(bool styleIsDark)
void QGCApplication::_loadCurrentStyle(void) void QGCApplication::_loadCurrentStyle(void)
{ {
#ifndef __mobile__
bool success = true; bool success = true;
QString styles; QString styles;
// Signal to the user that the app will pause to apply a new stylesheet
setOverrideCursor(Qt::WaitCursor);
// The dark style sheet is the master. Any other selected style sheet just overrides // The dark style sheet is the master. Any other selected style sheet just overrides
// the colors of the master sheet. // the colors of the master sheet.
QFile masterStyleSheet(_darkStyleFile); QFile masterStyleSheet(_darkStyleFile);
...@@ -687,11 +696,9 @@ void QGCApplication::_loadCurrentStyle(void) ...@@ -687,11 +696,9 @@ void QGCApplication::_loadCurrentStyle(void)
// Fall back to plastique if we can't load our own // Fall back to plastique if we can't load our own
setStyle("plastique"); setStyle("plastique");
} }
#endif
QGCPalette::setGlobalTheme(_styleIsDark ? QGCPalette::Dark : QGCPalette::Light); QGCPalette::setGlobalTheme(_styleIsDark ? QGCPalette::Dark : QGCPalette::Light);
// Finally restore the cursor before returning.
restoreOverrideCursor();
} }
void QGCApplication::reportMissingParameter(int componentId, const QString& name) void QGCApplication::reportMissingParameter(int componentId, const QString& name)
...@@ -718,12 +725,64 @@ void QGCApplication::_missingParamsDisplay(void) ...@@ -718,12 +725,64 @@ void QGCApplication::_missingParamsDisplay(void)
showMessage(QString("Parameters missing from firmware: %1.\n\nYou should quit QGroundControl immediately and update your firmware.").arg(params)); showMessage(QString("Parameters missing from firmware: %1.\n\nYou should quit QGroundControl immediately and update your firmware.").arg(params));
} }
QObject* QGCApplication::_rootQmlObject(void)
{
#ifdef __mobile__
return _qmlAppEngine->rootObjects()[0];
#else
return MainWindow::instance()->rootQmlObject();
#endif
}
void QGCApplication::showMessage(const QString& message) void QGCApplication::showMessage(const QString& message)
{ {
MainWindow* mainWindow = MainWindow::instance(); QVariant varReturn;
if (mainWindow) { QVariant varMessage = QVariant::fromValue(message);
mainWindow->showMessage(message);
} else { QMetaObject::invokeMethod(_rootQmlObject(), "showMessage", Q_RETURN_ARG(QVariant, varReturn), Q_ARG(QVariant, varMessage));
qWarning() << "showMessage with no mainWindow" << message; }
}
void QGCApplication::showFlyView(void)
{
QMetaObject::invokeMethod(_rootQmlObject(), "showFlyView");
}
void QGCApplication::showPlanView(void)
{
QMetaObject::invokeMethod(_rootQmlObject(), "showPlanView");
}
void QGCApplication::showSetupView(void)
{
QMetaObject::invokeMethod(_rootQmlObject(), "showSetupView");
}
void QGCApplication::showWindowCloseMessage(void)
{
QMetaObject::invokeMethod(_rootQmlObject(), "showWindowCloseMessage");
}
void QGCApplication::_showSetupFirmware(void)
{
QMetaObject::invokeMethod(_rootQmlObject(), "showSetupFirmware");
}
void QGCApplication::_showSetupParameters(void)
{
QMetaObject::invokeMethod(_rootQmlObject(), "showSetupParameters");
}
void QGCApplication::_showSetupSummary(void)
{
QMetaObject::invokeMethod(_rootQmlObject(), "showSetupSummary");
}
void QGCApplication::_showSetupVehicleComponent(VehicleComponent* vehicleComponent)
{
QVariant varReturn;
QVariant varComponent = QVariant::fromValue(vehicleComponent);
QMetaObject::invokeMethod(_rootQmlObject(), "showSetupVehicleComponent", Q_RETURN_ARG(QVariant, varReturn), Q_ARG(QVariant, varComponent));
} }
...@@ -64,7 +64,12 @@ class QGCToolbox; ...@@ -64,7 +64,12 @@ class QGCToolbox;
* the central management unit of the groundstation application. * the central management unit of the groundstation application.
* *
**/ **/
class QGCApplication : public QApplication class QGCApplication : public
#ifdef __mobile__
QGuiApplication // Native Qml based application
#else
QApplication // QtWidget based application
#endif
{ {
Q_OBJECT Q_OBJECT
...@@ -138,6 +143,12 @@ public slots: ...@@ -138,6 +143,12 @@ public slots:
/// You can connect to this slot to show a critical message box from a different thread. /// You can connect to this slot to show a critical message box from a different thread.
void criticalMessageBoxOnMainThread(const QString& title, const QString& msg); void criticalMessageBoxOnMainThread(const QString& title, const QString& msg);
void showFlyView(void);
void showPlanView(void);
void showSetupView(void);
void showWindowCloseMessage(void);
#ifndef __mobile__ #ifndef __mobile__
/// Save the specified Flight Data Log /// Save the specified Flight Data Log
void saveTempFlightDataLogOnMainThread(QString tempLogfile); void saveTempFlightDataLogOnMainThread(QString tempLogfile);
...@@ -166,6 +177,11 @@ public: ...@@ -166,6 +177,11 @@ public:
/// @brief Intialize the application for normal application boot. Or in other words we are not going to run /// @brief Intialize the application for normal application boot. Or in other words we are not going to run
/// unit tests. Although public should only be called by main. /// unit tests. Although public should only be called by main.
bool _initForUnitTests(void); bool _initForUnitTests(void);
void _showSetupFirmware(void);
void _showSetupParameters(void);
void _showSetupSummary(void);
void _showSetupVehicleComponent(VehicleComponent* vehicleComponent);
static QGCApplication* _app; ///< Our own singleton. Should be reference directly by qgcApp static QGCApplication* _app; ///< Our own singleton. Should be reference directly by qgcApp
...@@ -174,6 +190,11 @@ private slots: ...@@ -174,6 +190,11 @@ private slots:
private: private:
void _loadCurrentStyle(void); void _loadCurrentStyle(void);
QObject* _rootQmlObject(void);
#ifdef __mobile__
QQmlApplicationEngine* _qmlAppEngine;
#endif
static const char* _settingsVersionKey; ///< Settings key which hold settings version static const char* _settingsVersionKey; ///< Settings key which hold settings version
static const char* _deleteAllSettingsKey; ///< If this settings key is set on boot, all settings will be deleted static const char* _deleteAllSettingsKey; ///< If this settings key is set on boot, all settings will be deleted
......
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
#include "ParameterEditorController.h" #include "ParameterEditorController.h"
#include "AutoPilotPluginManager.h" #include "AutoPilotPluginManager.h"
#include "MainWindow.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#ifndef __mobile__ #ifndef __mobile__
#include "QGCFileDialog.h" #include "QGCFileDialog.h"
#include "QGCMapRCToParamDialog.h" #include "QGCMapRCToParamDialog.h"
#include "MainWindow.h"
#endif #endif
/// @Brief Constructs a new ParameterEditorController Widget. This widget is used within the PX4VehicleConfig set of screens. /// @Brief Constructs a new ParameterEditorController Widget. This widget is used within the PX4VehicleConfig set of screens.
......
...@@ -138,12 +138,6 @@ void QGroundControlQmlGlobal::setIsAudioMuted(bool muted) ...@@ -138,12 +138,6 @@ void QGroundControlQmlGlobal::setIsAudioMuted(bool muted)
emit isAudioMutedChanged(muted); emit isAudioMutedChanged(muted);
} }
void QGroundControlQmlGlobal::setIsLowPowerMode(bool low)
{
MainWindow::instance()->enableLowPowerMode(low);
emit isLowPowerModeChanged(low);
}
void QGroundControlQmlGlobal::setIsSaveLogPrompt(bool prompt) void QGroundControlQmlGlobal::setIsSaveLogPrompt(bool prompt)
{ {
qgcApp()->setPromptFlightDataSave(prompt); qgcApp()->setPromptFlightDataSave(prompt);
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <QObject> #include <QObject>
#include "QGCApplication.h" #include "QGCApplication.h"
#include "MainWindow.h"
#include "LinkManager.h" #include "LinkManager.h"
#include "HomePositionManager.h" #include "HomePositionManager.h"
#include "FlightMapSettings.h" #include "FlightMapSettings.h"
...@@ -63,7 +62,6 @@ public: ...@@ -63,7 +62,6 @@ public:
Q_PROPERTY(bool isAdvancedMode READ isAdvancedMode CONSTANT) ///< Global "Advance Mode" preference. Certain UI elements and features are different based on this. Q_PROPERTY(bool isAdvancedMode READ isAdvancedMode CONSTANT) ///< Global "Advance Mode" preference. Certain UI elements and features are different based on this.
Q_PROPERTY(bool isDarkStyle READ isDarkStyle WRITE setIsDarkStyle NOTIFY isDarkStyleChanged) // TODO: Should be in ScreenTools? Q_PROPERTY(bool isDarkStyle READ isDarkStyle WRITE setIsDarkStyle NOTIFY isDarkStyleChanged) // TODO: Should be in ScreenTools?
Q_PROPERTY(bool isAudioMuted READ isAudioMuted WRITE setIsAudioMuted NOTIFY isAudioMutedChanged) Q_PROPERTY(bool isAudioMuted READ isAudioMuted WRITE setIsAudioMuted NOTIFY isAudioMutedChanged)
Q_PROPERTY(bool isLowPowerMode READ isLowPowerMode WRITE setIsLowPowerMode NOTIFY isLowPowerModeChanged)
Q_PROPERTY(bool isSaveLogPrompt READ isSaveLogPrompt WRITE setIsSaveLogPrompt NOTIFY isSaveLogPromptChanged) Q_PROPERTY(bool isSaveLogPrompt READ isSaveLogPrompt WRITE setIsSaveLogPrompt NOTIFY isSaveLogPromptChanged)
Q_PROPERTY(bool isSaveLogPromptNotArmed READ isSaveLogPromptNotArmed WRITE setIsSaveLogPromptNotArmed NOTIFY isSaveLogPromptNotArmedChanged) Q_PROPERTY(bool isSaveLogPromptNotArmed READ isSaveLogPromptNotArmed WRITE setIsSaveLogPromptNotArmed NOTIFY isSaveLogPromptNotArmedChanged)
Q_PROPERTY(bool isHeartBeatEnabled READ isHeartBeatEnabled WRITE setIsHeartBeatEnabled NOTIFY isHeartBeatEnabledChanged) Q_PROPERTY(bool isHeartBeatEnabled READ isHeartBeatEnabled WRITE setIsHeartBeatEnabled NOTIFY isHeartBeatEnabledChanged)
...@@ -99,7 +97,6 @@ public: ...@@ -99,7 +97,6 @@ public:
bool isDarkStyle () { return qgcApp()->styleIsDark(); } bool isDarkStyle () { return qgcApp()->styleIsDark(); }
bool isAudioMuted () { return qgcApp()->toolbox()->audioOutput()->isMuted(); } bool isAudioMuted () { return qgcApp()->toolbox()->audioOutput()->isMuted(); }
bool isLowPowerMode () { return MainWindow::instance()->lowPowerModeEnabled(); }
bool isSaveLogPrompt () { return qgcApp()->promptFlightDataSave(); } bool isSaveLogPrompt () { return qgcApp()->promptFlightDataSave(); }
bool isSaveLogPromptNotArmed () { return qgcApp()->promptFlightDataSaveNotArmed(); } bool isSaveLogPromptNotArmed () { return qgcApp()->promptFlightDataSaveNotArmed(); }
bool isHeartBeatEnabled () { return qgcApp()->toolbox()->mavlinkProtocol()->heartbeatsEnabled(); } bool isHeartBeatEnabled () { return qgcApp()->toolbox()->mavlinkProtocol()->heartbeatsEnabled(); }
...@@ -112,7 +109,6 @@ public: ...@@ -112,7 +109,6 @@ public:
void setIsDarkStyle (bool dark); void setIsDarkStyle (bool dark);
void setIsAudioMuted (bool muted); void setIsAudioMuted (bool muted);
void setIsLowPowerMode (bool low);
void setIsSaveLogPrompt (bool prompt); void setIsSaveLogPrompt (bool prompt);
void setIsSaveLogPromptNotArmed (bool prompt); void setIsSaveLogPromptNotArmed (bool prompt);
void setIsHeartBeatEnabled (bool enable); void setIsHeartBeatEnabled (bool enable);
...@@ -123,7 +119,6 @@ public: ...@@ -123,7 +119,6 @@ public:
signals: signals:
void isDarkStyleChanged (bool dark); void isDarkStyleChanged (bool dark);
void isAudioMutedChanged (bool muted); void isAudioMutedChanged (bool muted);
void isLowPowerModeChanged (bool lowPower);
void isSaveLogPromptChanged (bool prompt); void isSaveLogPromptChanged (bool prompt);
void isSaveLogPromptNotArmedChanged (bool prompt); void isSaveLogPromptNotArmedChanged (bool prompt);
void isHeartBeatEnabledChanged (bool enabled); void isHeartBeatEnabledChanged (bool enabled);
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
/// @author Gus Grubba <mavlink@grubba.com> /// @author Gus Grubba <mavlink@grubba.com>
#include "ScreenToolsController.h" #include "ScreenToolsController.h"
#include "MainWindow.h"
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0; const double ScreenToolsController::_defaultFontPixelSizeRatio = 1.0;
......
...@@ -39,25 +39,25 @@ void SetupViewTest::_clickThrough_test(void) ...@@ -39,25 +39,25 @@ void SetupViewTest::_clickThrough_test(void)
_createMainWindow(); _createMainWindow();
// Switch to the Setup view // Switch to the Setup view
_mainWindow->showSetupView(); qgcApp()->showSetupView();
QTest::qWait(1000); QTest::qWait(1000);
// Click through fixed buttons // Click through fixed buttons
qDebug() << "Showing firmware"; qDebug() << "Showing firmware";
_mainWindow->showSetupFirmware(); qgcApp()->_showSetupFirmware();
QTest::qWait(1000); QTest::qWait(1000);
qDebug() << "Showing parameters"; qDebug() << "Showing parameters";
_mainWindow->showSetupParameters(); qgcApp()->_showSetupParameters();
QTest::qWait(1000); QTest::qWait(1000);
qDebug() << "Showing summary"; qDebug() << "Showing summary";
_mainWindow->showSetupSummary(); qgcApp()->_showSetupSummary();
QTest::qWait(1000); QTest::qWait(1000);
const QVariantList& components = autopilot->vehicleComponents(); const QVariantList& components = autopilot->vehicleComponents();
foreach(QVariant varComponent, components) { foreach(QVariant varComponent, components) {
VehicleComponent* component = qobject_cast<VehicleComponent*>(qvariant_cast<QObject *>(varComponent)); VehicleComponent* component = qobject_cast<VehicleComponent*>(qvariant_cast<QObject *>(varComponent));
qDebug() << "Showing" << component->name(); qDebug() << "Showing" << component->name();
_mainWindow->showSetupVehicleComponent(component); qgcApp()->_showSetupVehicleComponent(component);
QTest::qWait(1000); QTest::qWait(1000);
} }
......
...@@ -38,7 +38,6 @@ This file is part of the QGROUNDCONTROL project ...@@ -38,7 +38,6 @@ This file is part of the QGROUNDCONTROL project
#endif #endif
#include "LinkManager.h" #include "LinkManager.h"
#include "MainWindow.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "UDPLink.h" #include "UDPLink.h"
...@@ -189,14 +188,11 @@ void LinkManager::_addLink(LinkInterface* link) ...@@ -189,14 +188,11 @@ void LinkManager::_addLink(LinkInterface* link)
emit newLink(link); emit newLink(link);
} }
// MainWindow may be around when doing things like running unit tests connect(link, &LinkInterface::communicationError, _app, &QGCApplication::criticalMessageBoxOnMainThread);
if (MainWindow::instance()) { connect(link, &LinkInterface::bytesReceived, _mavlinkProtocol, &MAVLinkProtocol::receiveBytes);
connect(link, &LinkInterface::communicationError, _app, &QGCApplication::criticalMessageBoxOnMainThread); connect(link, &LinkInterface::connected, _mavlinkProtocol, &MAVLinkProtocol::linkConnected);
} connect(link, &LinkInterface::disconnected, _mavlinkProtocol, &MAVLinkProtocol::linkDisconnected);
connect(link, &LinkInterface::bytesReceived, _mavlinkProtocol, &MAVLinkProtocol::receiveBytes);
connect(link, &LinkInterface::connected, _mavlinkProtocol, &MAVLinkProtocol::linkConnected);
connect(link, &LinkInterface::disconnected, _mavlinkProtocol, &MAVLinkProtocol::linkDisconnected);
_mavlinkProtocol->resetMetadataForLink(link); _mavlinkProtocol->resetMetadataForLink(link);
connect(link, &LinkInterface::connected, this, &LinkManager::_linkConnected); connect(link, &LinkInterface::connected, this, &LinkManager::_linkConnected);
......
...@@ -169,7 +169,7 @@ public: ...@@ -169,7 +169,7 @@ public:
void _addLink(LinkInterface* link); void _addLink(LinkInterface* link);
// Called to signal app shutdown. Disconnects all links while turning off auto-connect. // Called to signal app shutdown. Disconnects all links while turning off auto-connect.
void shutdown(void); Q_INVOKABLE void shutdown(void);
#ifdef QT_DEBUG #ifdef QT_DEBUG
// Only used by unit test tp restart after a shutdown // Only used by unit test tp restart after a shutdown
......
...@@ -34,7 +34,6 @@ This file is part of the QGROUNDCONTROL project ...@@ -34,7 +34,6 @@ This file is part of the QGROUNDCONTROL project
#include <QProcessEnvironment> #include <QProcessEnvironment>
#include "QGCApplication.h" #include "QGCApplication.h"
#include "MainWindow.h"
#ifndef __mobile__ #ifndef __mobile__
#include "QGCSerialPortInfo.h" #include "QGCSerialPortInfo.h"
......
...@@ -159,7 +159,7 @@ MainWindow::MainWindow() ...@@ -159,7 +159,7 @@ MainWindow::MainWindow()
_mainQmlWidgetHolder->setVisible(true); _mainQmlWidgetHolder->setVisible(true);
_mainQmlWidgetHolder->setContextPropertyObject("controller", this); _mainQmlWidgetHolder->setContextPropertyObject("controller", this);
_mainQmlWidgetHolder->setSource(QUrl::fromUserInput("qrc:qml/MainWindow.qml")); _mainQmlWidgetHolder->setSource(QUrl::fromUserInput("qrc:qml/MainWindowHybrid.qml"));
// Image provider // Image provider
QQuickImageProvider* pImgProvider = dynamic_cast<QQuickImageProvider*>(qgcApp()->toolbox()->imageProvider()); QQuickImageProvider* pImgProvider = dynamic_cast<QQuickImageProvider*>(qgcApp()->toolbox()->imageProvider());
...@@ -436,7 +436,7 @@ void MainWindow::closeEvent(QCloseEvent *event) ...@@ -436,7 +436,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
{ {
// Disallow window close if there are active connections // Disallow window close if there are active connections
if (qgcApp()->toolbox()->multiVehicleManager()->vehicles()->count()) { if (qgcApp()->toolbox()->multiVehicleManager()->vehicles()->count()) {
emit showWindowCloseMessage(); qgcApp()->showWindowCloseMessage();
event->ignore(); event->ignore();
return; return;
} }
...@@ -548,12 +548,12 @@ void MainWindow::connectCommonActions() ...@@ -548,12 +548,12 @@ void MainWindow::connectCommonActions()
connect(_ui.actionSettings, SIGNAL(triggered()), this, SLOT(showSettings())); connect(_ui.actionSettings, SIGNAL(triggered()), this, SLOT(showSettings()));
// Views actions // Views actions
connect(_ui.actionFlight, &QAction::triggered, this, &MainWindow::showFlyView); connect(_ui.actionFlight, &QAction::triggered, qgcApp(), &QGCApplication::showFlyView);
connect(_ui.actionPlan, &QAction::triggered, this, &MainWindow::showPlanView); connect(_ui.actionPlan, &QAction::triggered, qgcApp(), &QGCApplication::showPlanView);
connect(_ui.actionSetup, &QAction::triggered, this, &MainWindow::showSetupView); connect(_ui.actionSetup, &QAction::triggered, qgcApp(), &QGCApplication::showSetupView);
connect(_ui.actionFlight, &QAction::triggered, this, &MainWindow::handleActiveViewActionState); connect(_ui.actionFlight, &QAction::triggered, this, &MainWindow::handleActiveViewActionState);
connect(_ui.actionPlan, &QAction::triggered, this, &MainWindow::handleActiveViewActionState); connect(_ui.actionPlan, &QAction::triggered, this, &MainWindow::handleActiveViewActionState);
connect(_ui.actionSetup, &QAction::triggered, this, &MainWindow::handleActiveViewActionState); connect(_ui.actionSetup, &QAction::triggered, this, &MainWindow::handleActiveViewActionState);
// Connect internal actions // Connect internal actions
connect(qgcApp()->toolbox()->multiVehicleManager(), &MultiVehicleManager::vehicleAdded, this, &MainWindow::_vehicleAdded); connect(qgcApp()->toolbox()->multiVehicleManager(), &MultiVehicleManager::vehicleAdded, this, &MainWindow::_vehicleAdded);
...@@ -670,7 +670,7 @@ void MainWindow::_storeVisibleWidgetsSettings(void) ...@@ -670,7 +670,7 @@ void MainWindow::_storeVisibleWidgetsSettings(void)
} }
#endif #endif
void MainWindow::showMessage(const QString message) QObject* MainWindow::rootQmlObject(void)
{ {
emit showCriticalMessage(message); return _mainQmlWidgetHolder->getRootObject();
} }
...@@ -31,6 +31,10 @@ This file is part of the QGROUNDCONTROL project ...@@ -31,6 +31,10 @@ This file is part of the QGROUNDCONTROL project
#ifndef _MAINWINDOW_H_ #ifndef _MAINWINDOW_H_
#define _MAINWINDOW_H_ #define _MAINWINDOW_H_
#ifdef __mobile__
#error Should not be include in mobile build
#endif
#include <QMainWindow> #include <QMainWindow>
#include <QStatusBar> #include <QStatusBar>
#include <QStackedWidget> #include <QStackedWidget>
...@@ -91,12 +95,12 @@ public: ...@@ -91,12 +95,12 @@ public:
/// @brief Saves the last used connection /// @brief Saves the last used connection
void saveLastUsedConnection(const QString connection); void saveLastUsedConnection(const QString connection);
/// @brief Show message in lower message window
void showMessage(const QString message);
// Called from MainWindow.qml when the user accepts the window close dialog // Called from MainWindow.qml when the user accepts the window close dialog
Q_INVOKABLE void acceptWindowClose(void); Q_INVOKABLE void acceptWindowClose(void);
/// @return Root qml object of main window QML
QObject* rootQmlObject(void);
public slots: public slots:
#ifndef __mobile__ #ifndef __mobile__
void showSettings(); void showSettings();
...@@ -140,20 +144,6 @@ protected slots: ...@@ -140,20 +144,6 @@ protected slots:
void handleActiveViewActionState(bool triggered); void handleActiveViewActionState(bool triggered);
signals: signals:
// Signals the Qml to show the specified view
void showFlyView(void);
void showPlanView(void);
void showSetupView(void);
void showCriticalMessage(const QString& message);
void showWindowCloseMessage(void);
// These are used for unit testing
void showSetupFirmware(void);
void showSetupParameters(void);
void showSetupSummary(void);
void showSetupVehicleComponent(VehicleComponent* vehicleComponent);
void initStatusChanged(const QString& message, int alignment, const QColor &color); void initStatusChanged(const QString& message, int alignment, const QColor &color);
/** Emitted when any value changes from any source */ /** Emitted when any value changes from any source */
void valueChanged(const int uasId, const QString& name, const QString& unit, const QVariant& value, const quint64 msec); void valueChanged(const int uasId, const QString& name, const QString& unit, const QVariant& value, const quint64 msec);
...@@ -173,6 +163,7 @@ public: ...@@ -173,6 +163,7 @@ public:
return logPlayer; return logPlayer;
} }
#endif #endif
protected: protected:
void connectCommonActions(); void connectCommonActions();
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
import QtQuick 2.5
import QtQuick.Controls 1.2
import QGroundControl.Controls 1.0
/// Native QML top level window
Item {
function showFlyView() {
mainWindowInner.item.showFlyView()
}
function showPlanView() {
mainWindowInner.item.showPlanView()
}
function showSetupView() {
mainWindowInner.item.showSetupView()
}
function showWindowCloseMessage() {
mainWindowInner.item.showWindowCloseMessage()
}
// The following are use for unit testing only
function showSetupFirmware() {
mainWindowInner.item.showSetupFirmware()
}
function showSetupParameters() {
mainWindowInner.item.showSetupParameters()
}
function showSetupSummary() {
mainWindowInner.item.showSetupSummary()
}
function showSetupVehicleComponent(vehicleComponent) {
mainWindowInner.item.showSetupVehicleComponent(vehicleComponent)
}
function showMessage(message) {
mainWindowInner.item.showMessage(message)
}
Loader {
id: mainWindowInner
anchors.fill: parent
source: "MainWindowInner.qml"
}
}
...@@ -33,9 +33,9 @@ import QGroundControl.FlightDisplay 1.0 ...@@ -33,9 +33,9 @@ import QGroundControl.FlightDisplay 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.MultiVehicleManager 1.0 import QGroundControl.MultiVehicleManager 1.0
/// Qml for MainWindow /// Inner common QML for MainWindow
Item { Item {
id: mainWindow id: mainWindow
readonly property string _planViewSource: "MissionEditor.qml" readonly property string _planViewSource: "MissionEditor.qml"
readonly property string _setupViewSource: "SetupView.qml" readonly property string _setupViewSource: "SetupView.qml"
...@@ -57,53 +57,62 @@ Item { ...@@ -57,53 +57,62 @@ Item {
property var activeVehicle: multiVehicleManager.activeVehicle property var activeVehicle: multiVehicleManager.activeVehicle
property string formatedMessage: activeVehicle ? activeVehicle.formatedMessage : "" property string formatedMessage: activeVehicle ? activeVehicle.formatedMessage : ""
Connections { function showFlyView() {
if(currentPopUp) {
target: controller currentPopUp.close()
onShowFlyView: {
if(currentPopUp) {
currentPopUp.close()
}
flightView.visible = true
setupViewLoader.visible = false
planViewLoader.visible = false
} }
flightView.visible = true
setupViewLoader.visible = false
planViewLoader.visible = false
toolbar.checkFlyButton()
}
onShowPlanView: { function showPlanView() {
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
}
if (planViewLoader.source != _planViewSource) {
planViewLoader.source = _planViewSource
}
flightView.visible = false
setupViewLoader.visible = false
planViewLoader.visible = true
} }
if (planViewLoader.source != _planViewSource) {
planViewLoader.source = _planViewSource
}
flightView.visible = false
setupViewLoader.visible = false
planViewLoader.visible = true
toolBar.checkPlanButton()
}
onShowSetupView: { function showSetupView() {
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
} }
if (setupViewLoader.source != _setupViewSource) { if (setupViewLoader.source != _setupViewSource) {
setupViewLoader.source = _setupViewSource setupViewLoader.source = _setupViewSource
}
flightView.visible = false
setupViewLoader.visible = true
planViewLoader.visible = false
} }
flightView.visible = false
setupViewLoader.visible = true
planViewLoader.visible = false
toolBar.checkSetupButton()
}
onShowCriticalMessage: showCriticalMessage(message) function showWindowCloseMessage() {
windowCloseDialog.open()
}
// The following are use for unit testing only
function showSetupFirmware() {
setupViewLoader.item.showFirmwarePanel()
}
onShowWindowCloseMessage: windowCloseDialog.open() function showSetupParameters() {
setupViewLoader.item.showParametersPanel()
}
// The following are use for unit testing only function showSetupSummary() {
setupViewLoader.item.showSummaryPanel()
}
onShowSetupFirmware: setupViewLoader.item.showFirmwarePanel() function showSetupVehicleComponent(vehicleComponent) {
onShowSetupParameters: setupViewLoader.item.showParametersPanel() setupViewLoader.item.showVehicleComponentPanel(vehicleComponent)
onShowSetupSummary: setupViewLoader.item.showSummaryPanel()
onShowSetupVehicleComponent: setupViewLoader.item.showVehicleComponentPanel(vehicleComponent)
} }
//-- Detect tablet position //-- Detect tablet position
...@@ -129,7 +138,7 @@ Item { ...@@ -129,7 +138,7 @@ Item {
property var messageQueue: [] property var messageQueue: []
function showCriticalMessage(message) { function showMessage(message) {
if(criticalMmessageArea.visible) { if(criticalMmessageArea.visible) {
messageQueue.push(message) messageQueue.push(message)
} else { } else {
...@@ -209,7 +218,7 @@ Item { ...@@ -209,7 +218,7 @@ Item {
//-- Left Settings Menu //-- Left Settings Menu
Loader { Loader {
id: leftPanel id: leftPanel
anchors.fill: mainWindow anchors.fill: parent
visible: false visible: false
z: QGroundControl.zOrderTopMost + 100 z: QGroundControl.zOrderTopMost + 100
} }
...@@ -226,9 +235,14 @@ Item { ...@@ -226,9 +235,14 @@ Item {
opaqueBackground: leftPanel.visible opaqueBackground: leftPanel.visible
isBackgroundDark: flightView.isBackgroundDark isBackgroundDark: flightView.isBackgroundDark
z: QGroundControl.zOrderTopMost z: QGroundControl.zOrderTopMost
Component.onCompleted: { Component.onCompleted: {
leftPanel.source = "MainWindowLeftPanel.qml" leftPanel.source = "MainWindowLeftPanel.qml"
} }
onShowSetupView: mainWindow.showSetupView()
onShowPlanView: mainWindow.showPlanView()
onShowFlyView: mainWindow.showFlyView()
} }
FlightDisplayView { FlightDisplayView {
...@@ -420,5 +434,5 @@ Item { ...@@ -420,5 +434,5 @@ Item {
} }
} }
} }
} }
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
import QtQuick 2.5
import QtQuick.Window 2.2
import QGroundControl 1.0
/// Native QML top level window
Window {
visible: true
onClosing: {
// Disallow window close if there are active connections
if (QGroundControl.multiVehicleManager.activeVehicle) {
showWindowCloseMessage()
close.accepted = false
return
}
// We still need to shutdown LinkManager even though no active connections so that we don't get any
// more auto-connect links during shutdown.
QGroundControl.linkManager.shutdown();
}
function showFlyView() {
mainWindowInner.item.showFlyView()
}
function showPlanView() {
mainWindowInner.item.showPlanView()
}
function showSetupView() {
mainWindowInner.item.showSetupView()
}
function showWindowCloseMessage() {
mainWindowInner.item.showWindowCloseMessage()
}
// The following are use for unit testing only
function showSetupFirmware() {
mainWindowInner.item.showSetupFirmware()
}
function showSetupParameters() {
mainWindowInner.item.showSetupParameters()
}
function showSetupSummary() {
mainWindowInner.item.showSetupSummary()
}
function showSetupVehicleComponent(vehicleComponent) {
mainWindowInner.showSetupVehicleComponent(vehicleComponent)
}
function showMessage(message) {
mainWindowInner.item.showMessage(message)
}
Loader {
id: mainWindowInner
anchors.fill: parent
source: "MainWindowInner.qml"
}
}
...@@ -81,15 +81,6 @@ Rectangle { ...@@ -81,15 +81,6 @@ Rectangle {
} }
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Low power mode
QGCCheckBox {
text: "Enable low power mode"
checked: QGroundControl.isLowPowerMode
onClicked: {
QGroundControl.isLowPowerMode = checked
}
}
//-----------------------------------------------------------------
//-- Prompt Save Log //-- Prompt Save Log
QGCCheckBox { QGCCheckBox {
id: promptSaveLog id: promptSaveLog
......
...@@ -145,8 +145,24 @@ Rectangle { ...@@ -145,8 +145,24 @@ Rectangle {
readonly property var colorBlue: "#636efe" readonly property var colorBlue: "#636efe"
readonly property var colorWhite: "#ffffff" readonly property var colorWhite: "#ffffff"
signal showSetupView()
signal showPlanView()
signal showFlyView()
MainToolBarController { id: _controller } MainToolBarController { id: _controller }
function checkSetupButton() {
setupButton.checked = true
}
function checkPlanButton() {
planButton.checked = true
}
function checkFlyButton() {
flyButton.checked = true
}
function getBatteryColor() { function getBatteryColor() {
if(activeVehicle) { if(activeVehicle) {
if(activeVehicle.batteryPercent > 75) { if(activeVehicle.batteryPercent > 75) {
...@@ -193,13 +209,6 @@ Rectangle { ...@@ -193,13 +209,6 @@ Rectangle {
flyButton.checked = true flyButton.checked = true
} }
Connections {
target: controller
onShowFlyView: { flyButton.checked = true }
onShowPlanView: { planButton.checked = true }
onShowSetupView:{ setupButton.checked = true }
}
//--------------------------------------------- //---------------------------------------------
// GPS Info // GPS Info
Component { Component {
...@@ -496,9 +505,7 @@ Rectangle { ...@@ -496,9 +505,7 @@ Rectangle {
height: mainWindow.tbCellHeight height: mainWindow.tbCellHeight
exclusiveGroup: mainActionGroup exclusiveGroup: mainActionGroup
source: "/qmlimages/Gears.svg" source: "/qmlimages/Gears.svg"
onClicked: { onClicked: toolBar.showSetupView()
_controller.onSetupView();
}
} }
Rectangle { Rectangle {
...@@ -513,9 +520,7 @@ Rectangle { ...@@ -513,9 +520,7 @@ Rectangle {
height: mainWindow.tbCellHeight height: mainWindow.tbCellHeight
exclusiveGroup: mainActionGroup exclusiveGroup: mainActionGroup
source: "/qmlimages/Plan.svg" source: "/qmlimages/Plan.svg"
onClicked: { onClicked: toolBar.showPlanView()
_controller.onPlanView();
}
} }
Rectangle { Rectangle {
...@@ -530,9 +535,7 @@ Rectangle { ...@@ -530,9 +535,7 @@ Rectangle {
height: mainWindow.tbCellHeight height: mainWindow.tbCellHeight
exclusiveGroup: mainActionGroup exclusiveGroup: mainActionGroup
source: "/qmlimages/PaperPlane.svg" source: "/qmlimages/PaperPlane.svg"
onClicked: { onClicked: toolBar.showFlyView()
_controller.onFlyView();
}
} }
Rectangle { Rectangle {
......
...@@ -32,7 +32,6 @@ This file is part of the QGROUNDCONTROL project ...@@ -32,7 +32,6 @@ This file is part of the QGROUNDCONTROL project
#include "MainToolBarController.h" #include "MainToolBarController.h"
#include "ScreenToolsController.h" #include "ScreenToolsController.h"
#include "MainWindow.h"
#include "UASMessageView.h" #include "UASMessageView.h"
#include "UASMessageHandler.h" #include "UASMessageHandler.h"
#include "QGCApplication.h" #include "QGCApplication.h"
...@@ -60,21 +59,6 @@ MainToolBarController::~MainToolBarController() ...@@ -60,21 +59,6 @@ MainToolBarController::~MainToolBarController()
} }
void MainToolBarController::onSetupView()
{
MainWindow::instance()->showSetupView();
}
void MainToolBarController::onPlanView()
{
MainWindow::instance()->showPlanView();
}
void MainToolBarController::onFlyView()
{
MainWindow::instance()->showFlyView();
}
void MainToolBarController::_activeVehicleChanged(Vehicle* vehicle) void MainToolBarController::_activeVehicleChanged(Vehicle* vehicle)
{ {
// Disconnect the previous one (if any) // Disconnect the previous one (if any)
......
...@@ -50,10 +50,6 @@ public: ...@@ -50,10 +50,6 @@ public:
MainToolBarController(QObject* parent = NULL); MainToolBarController(QObject* parent = NULL);
~MainToolBarController(); ~MainToolBarController();
Q_INVOKABLE void onSetupView();
Q_INVOKABLE void onPlanView();
Q_INVOKABLE void onFlyView();
Q_PROPERTY(double height MEMBER _toolbarHeight NOTIFY heightChanged) Q_PROPERTY(double height MEMBER _toolbarHeight NOTIFY heightChanged)
Q_PROPERTY(float progressBarValue MEMBER _progressBarValue NOTIFY progressBarValueChanged) Q_PROPERTY(float progressBarValue MEMBER _progressBarValue NOTIFY progressBarValueChanged)
Q_PROPERTY(int telemetryRRSSI READ telemetryRRSSI NOTIFY telemetryRRSSIChanged) Q_PROPERTY(int telemetryRRSSI READ telemetryRRSSI NOTIFY telemetryRRSSIChanged)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment